Reference
Errors
Every error has an HTTP status and a stable name you can match on.
Errors return a non-2xx status and a JSON body. Match on name; message is for people and may change.
{
"statusCode": 422,
"name": "validation_error",
"message": "The `from` address must be on a verified domain."
}| Name | Status | Meaning |
|---|---|---|
validation_error | 422 | A field is missing or invalid. The message says which. |
missing_api_key | 401 | The Authorization header is missing. |
invalid_api_key | 403 | The API key is wrong, revoked, or malformed. |
restricted_api_key | 401 | The key only has sending access, or is limited to another domain. |
not_found | 404 | The resource doesn't exist in this workspace. |
method_not_allowed | 405 | The path doesn't accept this HTTP method. |
invalid_idempotency_key | 400 | The Idempotency-Key header is empty or longer than 256 characters. |
invalid_idempotent_request | 409 | The Idempotency-Key was already used with a different request body. |
concurrent_idempotent_requests | 409 | A request with the same Idempotency-Key is still being processed. |
invalid_attachment | 422 | An attachment couldn't be read, fetched, or is too large. |
rate_limit_exceeded | 429 | Too many requests. Wait for retry-after seconds. |
monthly_quota_exceeded | 429 | The workspace reached its monthly send cap. |
workspace_paused | 403 | Sending is paused for the workspace, for billing or reputation reasons. |
application_error | 500 | Something went wrong on our side. Retry later. |
Retrying
- Retry
429afterretry-afterseconds, and500with backoff. - Use an idempotency key on sends so retries can't send twice.
- Don't retry other 4xx errors unchanged. Fix the request first.