Error Handling
Saturday uses one error format across all endpoints, modeled on Stripe’s error structure.Error format
A value of the wrong JSON type is refused with code
invalid_value and the field in param, on the athlete, activity, calculate, batch and gear routes: "duration_min": "90" answers “duration_min must be a whole number (got a string).” A nested field carries its path, such as settings.sweat_level. A body that is not JSON answers invalid_json.
A field the request does not take
A request made with a partner API key to calculate, batch, activity create, import, prep, product fit or compare may carry only the fields that request takes. Any other field, at any depth, is refused with400 and code unsupported_field, so a misspelled field never computes silently on a default. param is the field’s path in your body, and the message names the field it was probably meant to be:
weight_kg on calculate answers Send "athlete_weight_kg"., and activity_type on activity create answers Send "type". Activity create and import accept and ignore name and scheduled_at. The update routes (PATCH on athletes, activities, organizations and seat subscriptions) and webhook create also refuse fields they do not take with unsupported_field. Both SDKs raise a validation error carrying param, and suggestion with the field to send when the message names one.
A prescription Saturday could not compute
When Saturday cannot compute a prescription for a request it accepted, calculate, activity calculate, prep, product fit and compare answer500 with code internal_error and the message “Failed to calculate the prescription. Retry, and contact support if it persists.” The answer never carries zeros in place of numbers. Retry it as any 500, and quote the request_id if it repeats.
Error types
Branch ontype for handling class, and on code for the specific case. A type can span more than one status.
A 404 carries one of two types.
not_found_error means the URL itself found no endpoint (including endpoints not available to your key), always with code: "resource_not_found". resource_not_found as a type comes from an endpoint that could not find the thing you referenced, and its code narrows it: athlete_not_found, activity_not_found, prescription_not_found, key_not_found, webhook_not_found, integration_not_found (a disconnect for a provider the athlete never connected). Handle both types as the same case unless you need the distinction. The catalog also lists code: "not_found" for an endpoint that is not available in this environment, so treat that code as the same case too. A 429 carries type: "rate_limit_error", and its code says which limit was reached (Rate Limiting). Switching on type means using the values in the table above.200 with the clamped values plus safety.warnings and safety.requires_human_review set. See Safety.
Retry logic
Retrying
Every429, and every 503 with code service_unavailable, carries Retry-After in seconds. A 429 whose code is a daily ceiling waits until midnight UTC, so leave those out of a retry loop; Rate Limiting lists the codes.
POST that creates a record (an athlete, an activity, a webhook) may have succeeded before a 5xx: look the record up before sending it again. An athlete create that carries an external_id is safe to resend: if the first one went through, the retry answers 409 athlete_exists with the athlete’s id in athlete_id.
Request IDs
Every response carries anX-Request-ID header, and every error body repeats it as request_id, with one exception: a not_found_error 404 (a URL that matches no endpoint available to your key) carries neither. Quote the request ID when reporting an issue and we can trace that exact request.
Error catalog
GET /v1/errors (no auth) lists the error codes, leaving out features in STEALTH. Each entry’s retryable says whether you may retry the same call automatically after Retry-After: it is false for the daily ceilings, which clear only at midnight UTC. A code that appears only on one item of a batch, such as missing_identifier, is listed with the status a single request would get.