Skip to main content

How errors are returned

The Integrations API does not use a universal error_code field, and it does not return a request_id. Instead, errors are signalled by the HTTP status code and one of four response body shapes. Always branch on response.status_code first, then read the body shape that matches.

Error envelope shapes

Most domain errors return a detail message. Some also include a docs_url pointing at the relevant documentation.
The docs_url field is optional. Authentication failures (401) use this shape with messages such as Missing X-API-Key header, Invalid API key, This API key has expired, or This API key has been revoked.

Status codes

Common situations

These are real conditions you will encounter, described by status code and the style of detail message returned. There are no error-code constants to match against.

Retry guidance

Do not retry 400, 401, 402, 403, 404, 409, 413, 415, or 422 without changing the request. They indicate a problem with the request, the resource, or your plan that a retry alone cannot resolve.

Handling errors in code

Branch on the status code, then read the matching body shape. Read detail for domain errors and the fields array for validation errors. Do not look for error_code (except on 402) or request_id (which does not exist).
For 429 responses, wait for the duration in the Retry-After header before retrying. See Rate limiting for a complete backoff example.

Need help?