Error Handling

HTTP error codes, validation errors, retries.

HTTP status codes

Savitar follows standard REST status semantics. 4xx codes indicate a client error you should fix. 5xx codes are transient and safe to retry with exponential backoff.

Validation errors (422)

Request bodies that fail schema validation return 422 with a structured detail array describing each violation. Surface these errors to your developers rather than retrying.

{
  "detail": [
    { "loc": ["body", "text"], "msg": "field required", "type": "value_error.missing" }
  ]
}

Retry strategy

For 429 and 5xx responses, retry with exponential backoff (e.g. 1s, 2s, 4s, 8s) and a maximum of five attempts. Honor any Retry-After header the server returns.