Errors

The Zeitstrom API uses conventional HTTP response codes to indicate the success or failure of a request.

HTTP Status Codes

CodeDescription
200 OKThe request succeeded.
201 CreatedA new resource was created successfully.
204 No ContentThe request succeeded with no response body (e.g. after a DELETE).
400 Bad RequestThe request was invalid. Check the response body for validation details.
401 UnauthorizedNo valid API token was provided.
403 ForbiddenThe API token does not have permission for this action.
404 Not FoundThe requested resource does not exist.
405 Method Not AllowedThe HTTP method is not supported for this endpoint.
429 Too Many RequestsYou have exceeded the rate limit.
500 Internal Server ErrorSomething 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."]
}

Was this page helpful?