Error Response Format
All error responses follow this structure:| Field | Description |
|---|---|
code | Machine-readable error code |
message | Human-readable description |
field | The field that caused the error (if applicable) |
suggestion | Recommended action to fix the error |
requestId | Unique ID for support requests |
HTTP Status Codes
| Status | Description |
|---|---|
200 | Success |
201 | Resource created |
207 | Partial success (batch operations) |
400 | Bad request - invalid parameters |
401 | Unauthorized - invalid or missing API key |
403 | Forbidden - insufficient permissions |
404 | Resource not found |
409 | Conflict - resource already exists |
422 | Unprocessable - semantic error |
429 | Rate limit exceeded |
500 | Server error |
SDK Exception Types
All SDKs provide typed exceptions that map to HTTP status codes:| Exception | HTTP Status | Description |
|---|---|---|
BadRequestError | 400 | Invalid request parameters |
AuthenticationError | 401 | Invalid or missing API key |
PermissionDeniedError | 403 | Insufficient permissions |
NotFoundError | 404 | Resource not found |
UnprocessableEntityError | 422 | Validation error |
RateLimitError | 429 | Too many requests |
InternalServerError | 5xx | Server error |
APIConnectionError | — | Network/connection issue |
Handling Errors with SDKs
- Python
- Node.js
- Ruby
- Go
Error Codes Reference
Authentication Errors
| Code | Description | Solution |
|---|---|---|
authentication_required | No API key provided | Add Authorization: Bearer <key> header |
invalid_api_key | API key is malformed | Check key format (should start with ark_) |
expired_api_key | API key has been revoked | Generate a new key |
permission_denied | Key lacks required scope | Use a key with appropriate permissions |
Validation Errors
| Code | Description | Solution |
|---|---|---|
validation_error | Request failed validation | Check the field and suggestion |
invalid_email_format | Email address is invalid | Fix the email format |
missing_required_field | Required field not provided | Add the missing field |
invalid_field_value | Field value is not allowed | Check allowed values |
Resource Errors
| Code | Description | Solution |
|---|---|---|
resource_not_found | Resource doesn’t exist | Check the ID |
already_exists | Resource already exists | Use existing or choose different identifier |
invalid_state | Operation not allowed in current state | Check resource status |
Sending Errors
| Code | Description | Solution |
|---|---|---|
domain_not_verified | Sending domain not verified | Complete domain setup |
suppressed_recipient | Email is on suppression list | Remove from suppressions or skip |
quota_exceeded | Monthly sending limit reached | Upgrade plan or wait for reset |
Automatic Retries
All SDKs automatically retry failed requests with exponential backoff for:- Connection errors
- 408 Request Timeout
- 409 Conflict
- 429 Rate Limit
- 5xx Server Errors
- Python
- Node.js
- Ruby
- Go
Getting Help
If you encounter persistent errors:- Check the
requestIdin the error response - Review your request parameters
- Check the status page for outages
- Contact support with the
requestId
