Errors return a non-2xx status and a JSON body with one error object. Everything a program or an agent needs to
react is in the body, so a client that only sees the JSON can still decide what to do:
{
"error": {
"code": "invalid_input",
"message": "unknown parameter \"username\"; did you mean \"handle\"? This endpoint accepts: handle, max_age, fields.",
"request_id": "req_3f9c2a7d1e8b4c6a9f0e2d4b6a8c0e1f",
"status": 400,
"retryable": false,
"param": "username",
"remediation": "Fix the parameter named in param (the message says how); for a link of the wrong kind, call the endpoint the message names.",
"doc_url": "https://staging-fly.socialtap.dev/docs/errors/#invalid_input",
"details": {
"accepted_params": [
"handle",
"max_age",
"fields"
],
"suggestion": "handle"
},
"charged": false
}
}Every field is always present:
| Field | Type | Description |
|---|---|---|
error.code | string | Machine-readable error code (see the error codes list); stable. |
error.message | string | What went wrong and how to fix it, for humans and agents; wording may change. |
error.request_id | string | Unique request ID; include it when contacting support. |
error.status | integer | The HTTP status of the response, repeated for clients that only see the body. |
error.retryable | boolean | True when repeating the same request later may succeed (after details.retry_after when present). |
error.param | string or null | The query parameter or header the error is about; null when it is not about one input. |
error.remediation | string | What to do about this code, one sentence. |
error.doc_url | string | URL of this code's documentation. |
error.details | object | The code's dynamic values (the error codes list documents each code's keys); {} when none. |
error.charged | boolean | Whether the request was charged: always false, failed requests are free. |
error.paramnames the query parameter or header the error is about, so you can fix the call without parsing the message.error.detailsholds the code's dynamic values: the parameter you most likely meant, the endpoint a link belongs to, the credits a request needed. The table below lists each code's keys. Keys are only ever added.error.chargedis always false: failed requests are free (see Credits), so a retry costs nothing.
Error codes
Retry says whether sending the same request again later can get a different answer. What to do is the recommended reaction. Codes marked Reserved are documented ahead of the feature that returns them; nothing returns them yet.
| Code | HTTP | Retry | Meaning | What to do | details |
|---|---|---|---|---|---|
invalid_input | 400 | No | The request parameters are missing or malformed, or the URL is not a supported link for this endpoint. | Fix the parameter named in param (the message says how); for a link of the wrong kind, call the endpoint the message names. |
|
invalid_cursor | 400 | No | The cursor is malformed, expired, belongs to another endpoint, or the other parameters differ from the request that issued it. | Repeat the original request without cursor to start the list again. |
|
unauthorized | 401 | No | The x-api-key header is missing, unknown or revoked (or, on the dashboard's routes, the session cookie is missing or expired). | Send a valid API key in the x-api-key header; without one, get a key at details.signup_url (AI agents: POST details.agent_signup_url). |
|
forbidden | 403 | No | The API key is valid but may not make this request: its account is suspended, its scopes do not include the route, it is waiting for its owner's email confirmation, it is past its expiry, or the request came from an IP its allowlist does not include. A running job stops the same way when its account is suspended or the key that created it is revoked or expires. It is about the key, never the item (a private item is private_or_unavailable, also 403): branch on the code. | Do what details.reason says: if suspended, contact support; otherwise use a key whose scopes cover the route (details.required_scope), have the owner confirm the emailed link, create a new key, or call from an allowed IP. |
|
insufficient_credits | 402 | No | The account does not have enough credits for this request. | Buy credits (a human pays: details.purchase_url, or details.checkout makes a checkout link), then repeat the request; do not retry automatically. |
|
spend_limit_reached | 402 | No | The API key reached its spend limit for the current period; the account may still have credits. | Wait until details.resets_at or raise the key's spend limit (PATCH /v1/api_keys/{id}); do not retry automatically. |
|
rate_limited | 429 | Yes, later | The account exceeded its runaway-protection ceiling: plans do not limit request rate, but a high per-account safety ceiling stops broken client loops. Support raises it on request. Without an API key (signup, the MCP server's tool listing and find_endpoint), requests are limited per IP address instead. | Wait for the number of seconds in the retry-after header, then retry; ask support to raise the ceiling if your sustained traffic needs more (calls without an API key: use one). |
|
method_not_allowed | 405 | No | The endpoint exists but does not accept this HTTP method. | Use the method in the allow header (GET for every data endpoint). | — |
endpoint_retired | 410 | No | The endpoint passed its sunset date and no longer answers. | Call the replacement endpoint (details.replacement); the changelog describes the migration. |
|
idempotency_key_reused | 422 | No | The Idempotency-Key was already used with a different request (another route, or another body). | Send a new Idempotency-Key for a different request; reuse a key only to retry the identical request. | — |
idempotency_key_in_progress | 409 | Yes, later | A request with this Idempotency-Key is still running. | Retry after the number of seconds in the retry-after header to get that request's result. |
|
job_not_found | 404 | No | No job with this ID exists for the account: unknown, or past its retention. | Check the job ID; finished jobs are kept for a limited time. | — |
unknown_endpoint | 404 | No | No endpoint or route has this path: a typo, a platform that does not have this endpoint yet, or a path that is not part of the API. Nothing was fetched or charged. | Call the path in details.suggestion when it is set (it is the one the path most likely means), or pick one of details.endpoints; do not retry the same path. |
|
not_found | 404 | No | The item does not exist or was deleted. | Check the URL or ID; do not retry. | — |
private_or_unavailable | 403 | No | The item exists but is private, age- or region-gated, or requires a login to view. It shares 403 with forbidden (which is about the key): branch on the code. | Only public items can be fetched; do not retry. | — |
no_transcript | 404 | No | The media exists but has no transcript: no caption track and no speech to transcribe. | Do not retry; try another language with lang if the platform offers one. | — |
upstream_blocked | 503 | Yes, later | The platform refused every attempt. | Retry later with backoff; failed requests are free. | — |
upstream_error | 502 | Yes, later | The platform failed or returned something unexpected. | Retry with backoff; failed requests are free. | — |
overloaded | 503 | Yes, later | SocialTap was momentarily at capacity and did not start the request: nothing was fetched or charged. | Retry after the number of seconds in the retry-after header; failed requests are free. |
|
internal | 500 | Yes, later | Unexpected SocialTap error. | Retry with backoff; contact support with the request_id if it persists. | — |
Retrying
- Retry: yes. Retry with exponential backoff and a cap on attempts. For
rate_limited, wait at least the number of seconds in theretry-afterheader (also inerror.details) first, then retry. It is not a plan limit but the per-account safety ceiling against runaway clients (see Rate limits). - Retry: no. The code describes your request or the item, and the same request gets the same answer on every attempt: fix the input, top up your balance, or treat the item as unavailable, as the table says.
retry-afteris only ever sent with codes you may retry. Credit errors such asinsufficient_creditsnever carry it: buy credits, then repeat the request.