Documentation
Errors
Read the error envelope, decide what to do for each status, and look up every code.
Every error has the same shape and a stable code. No error costs credits.
Error Envelope
A refused call answers this body, with the HTTP status that matches its code.
{
"error": "No Instagram account matches this handle.",
"code": "NOT_FOUND"
}Prop
Type
A code never changes its meaning, but new codes can appear, so handle an unknown one by its status.
Error Codes
Each code always comes with the same status.
| Code | Status | Meaning |
|---|---|---|
INVALID_REQUEST | 400 | A parameter is missing or wrong |
UNAUTHENTICATED | 401 | The key is missing, revoked or expired |
INSUFFICIENT_CREDITS | 402 | The balance does not cover the call |
KEY_CREDIT_LIMIT_REACHED | 402 | The key spent its monthly limit |
PRIVATE | 403 | The account or the list is private |
NOT_FOUND | 404 | No such account, post or thing |
CONFLICT | 409 | The Idempotency-Key is in use |
SUSPENDED | 410 | The account exists, but is suspended |
RATE_LIMITED | 429 | Too many requests |
INTERNAL_ERROR | 500 | An error on our side |
UPSTREAM_UNAVAILABLE | 502 | The platform did not answer |
ENDPOINT_UNAVAILABLE | 503 | The endpoint is paused |
What to Do
The status tells you whether to fix the request, wait, or retry.
| Status | Do |
|---|---|
400 | Fix the parameter named in param |
401 | Send a valid key |
402 | Buy credits, or raise the key's limit |
403, 404, 410 | Do not retry. The answer will be the same |
409 | Use a new key, or wait for Retry-After |
429 | Wait for Retry-After |
500, 502, 503 | Try again shortly |
Retries
Retry with a growing pause, such as 1, 2, then 4 seconds, and wait at least Retry-After when it is sent. Failed calls are free, so retrying costs nothing until one succeeds.
A request that timed out may still have run. Send it with an Idempotency-Key, so a retry never pays twice.
Request Ids
Every response has an X-Request-Id, such as req_01m87tg3trs1ppxbs3h0ys092. Log it, and send it to support with a question.
The SDKs raise every error as a SocialAPIError. See SDKs.