Getting started
Errors
HTTP status codes and error codes returned by the Stack Emails API.
Errors use conventional HTTP status codes and a consistent JSON body:
{ "error": { "code": "validation_error", "message": "`to` must contain at least one recipient" } }
Every response also carries an x-request-id header. Include it when contacting support.
Status codes
| Status | Meaning |
|---|---|
200 / 201 / 202 |
Success (202 = accepted and queued) |
400 |
Invalid JSON |
401 |
Missing, invalid or revoked API key |
403 |
Key lacks permission, plan limit reached, or sender domain not allowed |
404 |
Resource not found |
409 |
Conflict (e.g. rescheduling an email that already sent) |
422 |
Validation failed |
429 |
Rate limit or sending quota exceeded |
500 |
Something went wrong on our side |
Common error codes
| Code | What to do |
|---|---|
missing_api_key / invalid_api_key |
Check the Authorization header |
restricted_api_key |
Use a full-access key for this endpoint |
validation_error |
Fix the field named in message |
invalid_from_address / domain_not_verified |
Verify the sender's domain first |
quota_exceeded |
Wait for your quota to reset or upgrade your plan |
rate_limited |
Back off and retry after the retry-after header |
account_suspended / account_restricted |
Contact support |