Guides

Errors & retries

Every error, at the request level or per target, uses one normalised shape, so you (or an agent) can handle failures the same way everywhere.

The error envelope

Errors return { "error": { … } } with a stable type, a human message, an optional platform, and a retryable boolean.

{
  "error": {
    "type": "entitlement_exceeded",
    "message": "Not enough credits: this post costs 5, you have 2.",
    "platform": null,
    "retryable": false
  }
}

Two levels of error

Error types

TypeHTTPMeaningRetry?
invalid_request400Malformed body or invalid field/option.Fix & resend
unauthorized401Missing or invalid API key.No
entitlement_exceeded402Out of credits, or your plan doesn't allow this (e.g. X/TikTok on free).After topping up / upgrading
rate_limited429Too many requests.Yes, after a short back-off
platform errorsA specific network rejected the target (see platform).Depends on the message

Retrying safely

When retryable is true (e.g. rate_limited), back off and retry. Always send the same Idempotency-Key on retries so a post that actually went out isn't duplicated. On 429, honour any Retry-After header. Non-retryable errors (unauthorized, invalid_request) need a fix, not a retry.