API Reference
Errors
API error codes and responses
All errors follow a consistent format:
{
"error": "error_code",
"message": "Human-readable description",
"status": 400
}Error Codes
| Status | Error Code | Description |
|---|---|---|
400 | bad_request | Missing or invalid request body |
401 | unauthorized | Missing, invalid, or expired API key |
403 | forbidden | API key lacks required scope |
404 | not_found | Resource not found or not accessible |
500 | internal_error | Server error |
Common Scenarios
Missing required field
{
"error": "bad_request",
"message": "to, subject, and text are required",
"status": 400
}Message not found
{
"error": "not_found",
"message": "Message not found",
"status": 404
}This also occurs when trying to access a message that belongs to a different identity.
Scope violation
{
"error": "forbidden",
"message": "Missing required scope: mail:send",
"status": 403
}