Skip to main content

Error response format

All API errors follow a consistent JSON envelope:

Error codes reference

Authentication errors (401)

Authorization errors (403)

Validation errors (400)

Not found errors (404)

Business logic errors (422)

Rate limiting (429)

Server errors (5xx)


Validation error details

When code is invalid_request, the details object contains per-field validation errors:

Handling errors in code


Retry strategy

For transient errors (5xx, 429), use exponential backoff with jitter:
Always include an X-Idempotency-Key when retrying send requests. This ensures retries don’t result in duplicate emails.