Skip to main content

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

StatusDescription
400 - Bad RequestThe request was malformed or contained invalid parameters
401 - UnauthorizedAuthentication failed or token is invalid
404 - Not FoundThe request resource was not found
409 - ConflictThe request conflicts with the current state (e.g. duplicate resource)
422 - Validation ErrorRequest 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"
}
]
}