Errors
API Response Codes
Our API uses conventional HTTP response codes to indicate the success or failure of API requests. In general:
- Codes in the
2xxrange indicate success - Codes in the
4xxrange indicate errors that failed given the information provided - Codes in the
5xxrange indicate errors with our servers
Error Response Format
All error responses follow a consistent format:
Error Response
{
"error": {
"code": "error_code_string",
"message": "A human-readable message describing the error"
}
}
Attributes
- code - A string identifier that indicates the specific type of error that occurred
- message - A human-readable message providing more details about the error
Error Codes
| Error Code | Description |
|---|---|
| Indicates an unexpected error occurred on our servers |
| The requested resource could not be found |
| A required parameter was not provided |
| The provided authentication token is invalid |
| No authentication token was provided |
Examples
Authentication Error (HTTP 401)
Response Headers
Status: 401 Unauthorized
Response Body
{
"error": {
"code": "invalid_token",
"message": "The provided authentication token is invalid"
}
}
Resource Not Found (HTTP 404)
Response Headers
Status: 404 Not Found
Response Body
{
"error": {
"code": "not_found",
"message": "Couldn't find User with 'id'=123"
}
}
Internal Server Error (HTTP 500)
Response Headers
Status: 500 Internal Server Error
Response Body
{
"error": {
"code": "internal_server_error",
"message": "An unexpected error occurred"
}
}