Errors
The error format and the stable error codes of the API.
Every error has the same JSON shape:
{
"error": {
"code": "plan_limit",
"message": "The Starter plan allows 300 uploads per hour",
"details": { "feature": "uploads_per_hour", "limit": 300 }
}
}code is stable: write your code against it. message is for people and may change. details is there when there is more to say, such as the field or the problems per account.
| HTTP | code | When |
|---|---|---|
| 400 | validation_failed | The request is not valid. details.issues lists the fields; a post that some accounts cannot take has details.targets. |
| 401 | unauthenticated | No credential, an unknown API key, or an expired OAuth token. |
| 403 | forbidden | The credential cannot do this: a read-only key writing, another workspace than its own, no access to the feature, or an owner/admin-only action. |
| 403 | plan_required | The workspace owner's plan does not include the feature (for example the API itself on the Free plan). details.feature names it. |
| 403 | plan_limit | A plan limit is reached (accounts, posts per month, storage, uploads per hour…). details.feature and details.limit say which. |
| 404 | not_found | The thing does not exist in this workspace. |
| 409 | conflict | The thing is in a state that does not allow this, such as changing a published post or canceling with nothing left to cancel. |
| 413 | validation_failed | The file is too large for this way of uploading (details.code: file_too_large). |
| 422 | validation_failed | The request is well formed but cannot be done, with a details.code, such as https_required, private_address, media_fetch_failed, account_expired, redirect_origin_not_allowed. |
| 429 | rate_limited | Too many requests; see Rate limits. details.retry_after is in seconds. |
| 500 | internal_error | Something went wrong on our side. Try again later. |
payment_failed and storage_failed can also appear on payment and storage problems.
What to retry
429: waitRetry-Afterseconds, then retry.500: retry with backoff. ForPOST /posts, send the sameIdempotency-Keyso a retry cannot create the post twice.400,403,404,409,422: retrying the same request gives the same answer; change the request first.
When a post fails on a platform, the post itself is created fine: its target gets status: failed with an error_code and error_message, and the post.failed webhook fires.