Error Response Format
All error responses follow this structure:A machine-readable error code for programmatic handling
A human-readable description of what went wrong
The category of error (validation_error, authentication_error, etc.)
Error Types
Validation Errors (400)
Returned when the request contains invalid data.| Code | Description |
|---|---|
invalid_format | Request body is malformed or missing required fields |
invalid_audio_format | Unsupported audio format (use MP3, WAV, OGG, AAC) |
invalid_external_id | External ID not found or not accessible |
invalid_parameter | A query or path parameter has an invalid value |
Authentication Errors (401)
Returned when authentication fails.| Code | Description |
|---|---|
invalid_token | Token is invalid, expired, or revoked |
missing_token | No X-API-Key header provided |
insufficient_permissions | Token lacks required permissions |
Resource Errors (404)
Returned when a requested resource doesn’t exist.| Code | Description |
|---|---|
audio_not_found | Audio file doesn’t exist or was deleted |
endpoint_not_found | The requested API endpoint doesn’t exist |
Conflict Errors (409)
Returned when the request conflicts with current state.| Code | Description |
|---|---|
audio_in_use | Cannot delete audio with pending sends |
duplicate_external_id | External ID is already in use |
Payload Errors (413)
Returned when the request body is too large.Rate Limit Errors (429)
Returned when you’ve exceeded your rate limit.Server Errors (5xx)
Returned when something goes wrong on our end.Handling Errors
Best Practices
Implement Retry Logic
Implement Retry Logic
For 429 and 5xx errors, implement retry with exponential backoff:
Log Error Details
Log Error Details
Always log the full error response for debugging:
- Error code and message
- Request ID (if provided)
- Timestamp
- Request details (endpoint, method, params)
Handle Gracefully
Handle Gracefully
- Show user-friendly messages (not raw error codes)
- Provide actionable next steps when possible
- Don’t expose internal error details to end users

