Guide
Error handling
Every error shares the same structure, with stable error codes your client can act on.
Every failed call returns the same basic structure, so a single error handler is enough for the whole API.
{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "One or more request parameters are invalid.",
"param": null,
"request_id": "req_9f3a1c0d2b4e6a8c1d3f",
"errors": [
{ "param": "limit", "message": "must be an integer 1-100" }
]
}
}
-
typegives the broad error category. -
codeis the stable machine code your client logic should switch on. -
messagegives a short explanation in English and never echoes sensitive input. -
paramidentifies the parameter when the error concerns one specific field. -
request_idmatches the response'sX-Request-Id. Include the value when you contact support.
Error codes
| HTTP | Code | What to do |
|---|---|---|
| 401 | invalid_api_key | Check that the correct active key is being sent as the Bearer token |
| 403 | missing_scope | Request the right scope, or use a resource the key is allowed to read |
| 403 | terms_acceptance_required | Accept the latest version of the data terms |
| 403 | not_in_plan | Change plan, or ask for the feature to be added to your agreement |
| 404 | not_found | Check the identifier, or treat the record as missing |
| 400 | invalid_request | Correct the request before sending it again |
| 400 | invalid_cursor | Restart the listing from the first page |
| 400 | cursor_conflict | Go back to the filters from the first page, or start a new listing |
| 410 | cursor_expired | Start over, because the page cursor has expired |
| 422 | validation_error | Correct the field named in error.errors |
| 429 | rate_limited | Wait for the time given in Retry-After |
| 429 | monthly_quota_exceeded | Pause until next month, or raise the quota |
| 503 | query_timeout | Narrow the selection and try again |
| 503 | service_unavailable | Retry with backoff after the stated wait |
| 500 | internal_error | Log the request_id and contact us if the error recurs |
Unknown parameters are rejected
If a filter is misspelled the API responds with 422. For example, ?min_revenu=5 is rejected outright. So you are never at risk of a mistyped filter quietly returning a huge selection.
404 and unknown identifiers
Malformed, unknown and disallowed identifiers all produce the same 404 response. The API does not echo the value you submitted. That means the response cannot be used to check whether a particular person appears in the registry.