Error Handling
Structured error responses with machine-readable codes for reliable integration.
Error envelope
All errors return a consistent JSON structure:
Error codes
Handle errors by switching on the error.code field, not the HTTP status code.
Example error responses
Validation error (422):
Authentication error (401):
Rate limit error (429):
Handling errors in code
Switch on error.code rather than HTTP status for precise handling.
Python
TypeScript
Validation errors
For 422 responses, the param field uses dot notation for nested fields (e.g., stops[0].address.city). Validate your payload structure against the API Reference before sending requests.

