status field in the response envelope to signal success or failure. On error, status is false and message describes the problem.
Error response format
Error responses look like this:boolean
Always
false for error responses. Check this field first in your error-handling logic.string
A human-readable description of what went wrong. Use this for logging and debugging.
string
A stable, machine-readable code identifying the error type. Branch your error handling on this field, not on
message — message text may change, error.code won’t. See the table below for every value.array
Field-level validation errors, each with a
field and message. Only present when the error is caused by one or more invalid request fields — omitted entirely otherwise (not null, not []).Error responses have no
data field at all — not even data: null. Only success responses include data.Error codes
HTTP status codes
Rate limit responses
A429 response includes a Retry-After header — the number of seconds to wait before retrying:
Handling errors in code
Always check
json.status (the field in the response body) in addition to the HTTP status code. Some error conditions may return 200 with status: false.Authentication errors
A401 AUTHENTICATION_ERROR is returned whenever a request can’t be authenticated. The message falls into one of two buckets:
"Unauthorized"— the request is missingx-api-keyand/orx-api-secretentirely, or combines them with anAuthorization: Bearerheader (that combination is rejected)."Invalid credentials"— both headers were sent, but the API key isn’t recognized, the secret doesn’t match, or the key has been revoked.
401, check that:
- Both
x-api-keyandx-api-secretare present, exactly as issued (no truncation or extra whitespace). - You are not also sending an
Authorization: Bearerheader alongside them. - The key hasn’t been revoked or replaced by a regenerated secret — see Authentication for rotation and revocation timing.
403 FORBIDDEN means the credentials themselves are valid but aren’t permitted for the resource requested.
See Authentication for the full credential reference, including rate limits.