Get started
Errors
The statuses the API really returns and the error envelope.
Envelope
Every error comes back in an error object with code, message and meta. The code is stable; the message is for people and may change; meta carries the field or limit involved.
400 VALIDATION_FAILED
Codes
| HTTP | code | When it happens |
|---|---|---|
| 400 | VALIDATION_FAILED | A body or query field is invalid; meta says which. |
| 400 | INVALID_RECIPIENT | The recipient is not a valid address. |
| 401 | UNAUTHORIZED | Missing, invalid or revoked key. |
| 409 | DOMAIN_NOT_VERIFIED | The sender domain has not passed DNS verification yet. |
| 409 | EMAIL_NOT_CANCELLABLE | Only scheduled emails not yet sent can be cancelled. |
| 422 | INVALID_FROM_DOMAIN | The from address uses a domain that does not belong to the organization. |
| 422 | SENDER_NOT_VERIFIED | The single sender has not confirmed the email yet. |
| 429 | PLAN_QUOTA_EXCEEDED | The plan quota ran out in the cycle; enable overage or change plans. |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests; wait the retry-after time. |
| 500 | TEMPLATE_RENDER_ERROR | The template did not render with the variables sent. |
Keep the x-request-id from the response: support finds the request with it right away.
In the SDKs
The SDKs do not throw on API errors: the error comes typed in the result, with code, status and requestId.
Node.js
Go