Check whether an upload fits the storage plan

posthttps://api.expiryedge.com/v1/checkUpload
any role60/minAny method
Request
curl -X POST 'https://api.expiryedge.com/v1/checkUpload' \
  -H "Authorization: Bearer $EXPIRYEDGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "file_size": 2097152
}'
Response
{
  "success": true,
  "allowed": true,
  "current_usage": 52428800,
  "current_usage_formatted": "50 MB",
  "limit": 1073741824,
  "limit_formatted": "1 GB",
  "file_size": 2097152,
  "file_size_formatted": "2 MB"
}

Call before uploading files. file_size is the total bytes of the planned upload (positive integer, max 524288000). Body organization_id and plan_name are ignored.

Body parameters

application/json
  • file_sizeintegerrequired
    Bytes to upload.
    min: 1 · max: 524288000

Returns

200
Whether the upload is allowed. allowed is false (still 200) when it would exceed the limit.
  • successboolean
  • allowedboolean
  • reasonstring
    Present when not allowed (for example Storage limit exceeded).
  • current_usageinteger
  • current_usage_formattedstring
  • limitinteger
  • limit_formattedstring
  • file_sizeinteger
  • file_size_formattedstring

Errors

400
The request is missing required fields or contains invalid values.
401
Missing, expired or invalid bearer token.
403
Authenticated, but your role or organization does not allow this action.
429
Too many requests for this endpoint from your IP. Wait Retry-After seconds.
500
Unexpected server error. Retry later; quote requestId to support.