Error envelope
A failed response uses a different shape from a success response — don’t reuse your success-parsing code for errors:HTTP status codes
Common error scenarios
400 validation error
Happens when required fields are missing or a field type is wrong. error.message is an array — one entry per failing field:
401 missing key
X-API-Key header is actually present on the request.
404 invalid or expired key
An unrecognized or revoked key value returns 404, not 401:
expiresAt returns 400 with "message": "API key has expired" instead. In all three cases, check that X-API-Key is present, the value is the full key secret (not the publicKey), and the key hasn’t been revoked or expired.
403 scope denied
message always names the specific missing scope. Add it to your key:
429 rate limited
rateLimitPerMinute/rateLimitPerHour values you can set on a key.
Troubleshooting checklist
- Log the full request URL, method, headers (redact the key value), and response body.
- Check
successanderror.messagein the response envelope. - For
401/404/403— re-read Authentication and verify key scopes. - For
400— compare your request body against the request body table in the endpoint’s documentation; remembererror.messagemay be an array. - For
500— retry once. If the error persists, contact support with the endpoint, payload, and a timestamp.