Reference
Errors and limits
Error format, status codes, rate limits and pagination.
Error format
Failed requests return a non-2xx status and a JSON body.
{
"statusCode": 422,
"name": "validation_error",
"message": "The `to` field must contain at least one valid email address."
}Status codes
| Status | Meaning |
|---|---|
| 200, 201, 202 | Success. 202 means the work was accepted and will finish in the background. |
| 400 | The request could not be parsed. |
| 401 | Missing, invalid or revoked API key. |
| 403 | The key does not have permission, or the team is paused. |
| 404 | The resource does not exist or belongs to another team. |
| 409 | The idempotency key was reused with a different body. |
| 422 | Validation failed, for example an unverified from domain. |
| 429 | Rate limit or daily quota exceeded. |
| 500, 503 | Something went wrong on our side. Retry with backoff. |
Rate limits
Each API key can make 10 requests per second by default. Every response includes the current state, and a 429 response includes retry-after.
| Header | Meaning |
|---|---|
ratelimit-limit | Requests allowed in the window. |
ratelimit-remaining | Requests left in the window. |
ratelimit-reset | Seconds until the window resets. |
retry-after | Seconds to wait before retrying, on 429. |
Pagination
List endpoints use cursors. Pass limit (up to 100) and after or before with a cursor from a previous response.
{
"data": [ /* items */ ],
"has_more": true,
"next_cursor": "eyJpZCI6Im1zZ18xZzlvbCJ9"
}Retrying safely
- Retry
429and5xxresponses with exponential backoff and jitter. - Always send an
Idempotency-Keywhen retryingPOST /emailsso nothing sends twice. - Do not retry
4xxerrors other than429. Fix the request first.