Error handling

The API uses standard HTTP status codes for error reporting, along with a JSON error message in the response body to help diagnose issues. Common error responses include:

HTTP Status Code
Meaning

400 Bad Request

The request was malformed or failed validation (e.g., missing required fields, invalid parameter format, etc.).

401 Unauthorized

Authentication failed – either the Authorization header is missing, the token is invalid/expired, or you lack permission to access the resource.

404 Not Found

The requested resource does not exist. This could mean the endpoint is incorrect or the query is incorrect {domain}/{expression}

When an error occurs, the response body will typically include a JSON object with an error field describing what went wrong. For example:

{
  "error": "Invalid 'to' timestamp: Invalid timestamp or format: 2025-05-25T09:41:00, valid formats are ISO8601 or YYYY-MM-DD"
}

In this example, the error message indicates that the to query parameter was not in an acceptable format. These messages can help you adjust your request accordingly.

Last updated