Errors
The Zeitstrom API uses conventional HTTP response codes to indicate the success or failure of a request.
HTTP Status Codes
| Code | Description |
|---|---|
200 OK | The request succeeded. |
201 Created | A new resource was created successfully. |
204 No Content | The request succeeded with no response body (e.g. after a DELETE). |
400 Bad Request | The request was invalid. Check the response body for validation details. |
401 Unauthorized | No valid API token was provided. |
403 Forbidden | The API token does not have permission for this action. |
404 Not Found | The requested resource does not exist. |
405 Method Not Allowed | The HTTP method is not supported for this endpoint. |
429 Too Many Requests | You have exceeded the rate limit. |
500 Internal Server Error | Something went wrong on our end. |
Error Response Format
Error responses include a detail field with a human-readable message:
Authentication Error (401)
{
"detail": "Invalid token."
}
Permission Error (403)
{
"detail": "You do not have permission to perform this action."
}
Not Found (404)
{
"detail": "Not found."
}
Validation Errors
When a request fails validation, the API returns a 400 status with field-level error details:
Validation Error (400)
{
"first_name": ["This field may not be blank."],
"email": ["Enter a valid email address."]
}
For non-field errors, the response uses the non_field_errors key:
Non-Field Error (400)
{
"non_field_errors": ["The checkout time must be after the checkin time."]
}