Error response format
When a request fails, the API returns a JSON body with a top-levelerror object:
message— Always present. A human-readable description of what went wrong.code— Optional. A numeric error code useful when contacting support.errors— Optional. An array of field-level validation errors. Each entry contains afieldname and amessageexplaining the problem with that field.
HTTP status codes
Handling errors in practice
Follow these best practices to make your integration resilient to API errors:- Always check the HTTP status code before parsing the response body.
- Log the full error object for debugging — the
messageandcodefields are especially useful. - For
500errors, retry the request with exponential backoff rather than failing immediately. - For
401errors, verify your API key is correctly passed in theX-Api-Keyheader. - For
400errors, inspect theerrorsarray for field-level details pointing to the exact invalid input.