Errors and limits
The error format, safe retries with idempotency keys, rate limits and plan limits of the API.
Error format
Every error has the same shape. code is stable and meant for your script; message is meant for
a person.
{ "error": { "code": "forbidden", "message": "This API key does not have the posts.write scope." } }Request bodies are JSON with strict fields: an unknown field answers 400.
| Status | Code | When |
|---|---|---|
400 | validation | The body, a parameter or a header is not valid |
401 | unauthenticated | The key is missing, wrong, expired or revoked. The answer is the same for each. |
403 | forbidden | The key lacks the scope, cannot reach this brand, or the endpoint is closed to keys |
403 | feature_not_in_plan | The organization's plan does not include the feature |
404 | not_found | The resource does not exist, or belongs to another organization |
409 | conflict | The request does not fit the resource's current state |
409 | A code ending in _limit_reached | A plan limit is reached; see Plan limits |
413 | payload_too_large | The request body is too large |
415 | unsupported_media_type | The content type is not accepted |
422 | idempotency_mismatch | The idempotency key was used for a different request |
429 | rate_limited | Too many requests in one minute |
429 | api_requests_limit_reached | The organization's API requests for the month are used up |
500 | internal | Something failed on our side |
Safe retries
Send an Idempotency-Key header with any request that changes something. Use a value of up to
255 characters that is unique to the action, for example an id from your own system.
- The same key with the same request returns the first answer again, marked with the header
Idempotent-Replayed: true. - The same key with a different request answers
422. - A request with the same key that is still running answers
409with the coderequest_in_progress.
A key is remembered for 24 hours. An answer with a 5xx status is not remembered, so the same key
can be sent again.
Rate limits
Each key may make 120 requests per minute. Every answer carries the current state:
| Header | Meaning |
|---|---|
RateLimit-Limit | Requests allowed per minute |
RateLimit-Remaining | Requests left in this minute |
RateLimit-Reset | Seconds until the minute ends |
Above the limit, the request answers 429 with rate_limited and a Retry-After header in
seconds.
Monthly API requests
Besides the per-minute limit, each plan includes a number of API requests per month for the whole organization, across all its keys.
| Plan | API requests per month |
|---|---|
| Free | 3,000 |
| Starter | 15,000 |
| Team | 75,000 |
| Agency | 250,000 |
When they are used up, requests answer 429 with api_requests_limit_reached and a Retry-After
header that points to the start of the next month.
Plan limits
When a request would exceed what the organization's plan allows, it answers 409 with a code that
names the limit. The codes a key can meet:
| Code | Limit |
|---|---|
storage_limit_reached | Stored media |
upload_limit_reached | Upload volume this month |
publication_limit_reached | Publications this month |
The message says which limit it was. Retrying does not help until the plan changes or the period ends.