Error Handling
The API uses conventional HTTP response codes to indicate the success or failure of requests.
In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error with the provided information and codes in the 5xx range indicate an error with our servers.
Common Error Responses
Status | Description |
---|---|
400 - Bad Request | The request was malformed or contained invalid parameters |
401 - Unauthorized | Authentication failed or token is invalid |
404 - Not Found | The request resource was not found |
409 - Conflict | The request conflicts with the current state (e.g. duplicate resource) |
422 - Validation Error | Request validation failed, check the error details |
Error Response Format
Error responses typically include a JSON object with details about the error:
{
"detail": "Error description message"
}
For validation errors, the response includes more detailed information about the error:
{
"detail": [
{
"loc": ["body", "field_name"],
"msg": "Error message",
"type": "error_type"
}
]
}