Skip to content
Reference

Errors

The error envelope and every error code.

FomoData uses conventional HTTP status codes and one JSON error envelope for every failure. Branch on the machine-readable code, not on the message text.

Error format

422 Unprocessable Entity
{
  "error": {
    "type": "invalid_request",
    "code": "INVALID_TOKEN",
    "message": "Token could not be resolved.",
    "request_id": "req_6Yq1Hn0bVx3LmT8sRk2Wc4",
    "param": "token",
    "doc_url": "https://fomodata.dev/docs/errors#invalid_token"
  }
}
FieldDescription
typeBroad category, listed below.
codeSpecific, stable error code. Safe to branch on.
messageHuman-readable explanation. May change; don't parse it.
request_idSame as the X-FomoData-Request-Id header.
paramThe offending parameter, when there is one.
detailsExtra structured data, e.g. validation issues or AMBIGUOUS_TOKEN candidates.
doc_urlA link to this page, anchored to the code.

HTTP status codes

StatusMeaning
200 / 201Success / created.
400Malformed request, invalid cursor, test-only endpoint called with a live key.
401Missing, invalid, revoked or expired API key.
403Insufficient scope, live access not approved, history limit, archived project, webhook endpoint limit (WEBHOOK_LIMIT_REACHED).
404Not found, or the feature is disabled.
409Conflict, e.g. an ambiguous token symbol.
422Validation failed.
429Rate limit, monthly quota or stream connection limit.
500Internal error.
502The upstream returned an invalid response.
503The upstream is unavailable (circuit open) or upstream capacity is exhausted.

Error types

TypeWhat to do
invalid_requestFix the request. Retrying unchanged will fail again.
authentication_errorCheck the key: present, correct, not revoked or expired.
permission_errorThe key is valid but not allowed to do this (scope, live approval, history window, archived project, plan webhook limit).
not_foundThe object doesn't exist, or the feature isn't available on this deployment.
conflictThe request is ambiguous or conflicts with current state. Read details and resend.
rate_limitSlow down. Retry after the Retry-After header or X-RateLimit-Reset.
api_errorOur fault. Safe to retry with backoff; include the request id if it persists.
upstream_errorThe upstream Fomo data source returned something invalid. Retry with backoff.
upstream_unavailableThe upstream is unavailable or capacity is exhausted. Retry after Retry-After; cached data may still be served elsewhere.

Error codes

Each code has an anchor, so doc_url lands right on its row.

Retrying safely

  • Retry 429, 500, 502 and 503 with exponential backoff and jitter. Always honour Retry-After when present.
  • Don't retry other 4xx responses unchanged; they will fail the same way.
  • QUOTA_EXCEEDED won't clear until your monthly quota resets or you upgrade.