Skip to main content

Error Handling

Saturday uses a consistent error format across all endpoints, modeled on Stripe’s error structure. Errors are predictable, machine-readable, and include enough context to diagnose the issue without consulting logs.

Error format

Every error response follows this structure:

Error types

Branch on type, not code. For a 404 the type is not_found_error while the more specific code is resource_not_found; for a 429 the type is rate_limit_error while the code is rate_limit_exceeded. If you switch on error.type, use the values in the table above.

Retry logic

Exponential backoff implementation

Request IDs

Every response includes a request_id in both the response body and the X-Request-Id header. Always include this when reporting issues — it lets us trace the exact request through our systems.