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 EntityJSON
{
"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"
}
}| Field | Description |
|---|---|
type | Broad category, listed below. |
code | Specific, stable error code. Safe to branch on. |
message | Human-readable explanation. May change; don't parse it. |
request_id | Same as the X-FomoData-Request-Id header. |
param | The offending parameter, when there is one. |
details | Extra structured data, e.g. validation issues or AMBIGUOUS_TOKEN candidates. |
doc_url | A link to this page, anchored to the code. |
HTTP status codes
| Status | Meaning |
|---|---|
| 200 / 201 | Success / created. |
| 400 | Malformed request, invalid cursor, test-only endpoint called with a live key. |
| 401 | Missing, invalid, revoked or expired API key. |
| 403 | Insufficient scope, live access not approved, history limit, archived project, webhook endpoint limit (WEBHOOK_LIMIT_REACHED). |
| 404 | Not found, or the feature is disabled. |
| 409 | Conflict, e.g. an ambiguous token symbol. |
| 422 | Validation failed. |
| 429 | Rate limit, monthly quota or stream connection limit. |
| 500 | Internal error. |
| 502 | The upstream returned an invalid response. |
| 503 | The upstream is unavailable (circuit open) or upstream capacity is exhausted. |
Error types
| Type | What to do |
|---|---|
invalid_request | Fix the request. Retrying unchanged will fail again. |
authentication_error | Check the key: present, correct, not revoked or expired. |
permission_error | The key is valid but not allowed to do this (scope, live approval, history window, archived project, plan webhook limit). |
not_found | The object doesn't exist, or the feature isn't available on this deployment. |
conflict | The request is ambiguous or conflicts with current state. Read details and resend. |
rate_limit | Slow down. Retry after the Retry-After header or X-RateLimit-Reset. |
api_error | Our fault. Safe to retry with backoff; include the request id if it persists. |
upstream_error | The upstream Fomo data source returned something invalid. Retry with backoff. |
upstream_unavailable | The 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.
- The request failed validation.
- The request is malformed.
- The pagination cursor is invalid or expired.
- Token could not be resolved.
- The handle is not a valid Fomo handle.
- created_after must be before created_before.
- This webhook URL is not allowed.
- This endpoint is only available with a test key.
- The request body is too large.
- No API key provided. Use 'Authorization: Bearer fd_…'.
- The API key is invalid.
- The API key has been revoked.
- The API key has expired.
- The API key does not have the required scope.
- This project is not approved for live data.
- The requested window is older than your plan's history limit.
- The project for this key is archived.
- This project has reached its plan's webhook endpoint limit for this environment.
- This feature is not available.
- The requested resource does not exist.
- No Fomo profile matches that reference.
- No thesis matches that id.
- No token matches that reference.
- No event matches that id.
- No webhook matches that id.
- No webhook delivery matches that id.
- More than one token matches that symbol. Pass a chain or use the token id/address.
- The request conflicts with the current state.
- Too many requests. Slow down and retry after the reset time.
- Monthly request quota exhausted for this plan.
- Too many concurrent stream connections for this plan.
- Something went wrong on our side.
- The upstream Fomo data source returned an invalid response.
- Upstream capacity is temporarily exhausted; only cached data can be served.
Retrying safely
- Retry
429,500,502and503with exponential backoff and jitter. Always honourRetry-Afterwhen present. - Don't retry other
4xxresponses unchanged; they will fail the same way. QUOTA_EXCEEDEDwon't clear until your monthly quota resets or you upgrade.