Errors and Status Codes

Tsara uses the HTTP status code together with the JSON envelope.

Common status code patterns

200

Request succeeded.

400

Invalid request payload, missing required input, or unsupported combination.

401

Unauthorized. Usually means the wrong key type or an invalid token was supplied.

404

Requested resource was not found.

409

Conflict, duplicate, or insufficient-balance condition depending on the endpoint.

422

Structured validation failure.

500

Internal application error.

502

Upstream provider failure or provider rejection when Tsara cannot return a cleaner downstream code.

503

Temporary service unavailability, commonly when a provider quote or provisioning dependency is unavailable.

Error handling guidance

  • always read both the HTTP status code and message
  • if errors is present, show or log field-level validation details
  • treat 502 and 503 as retry-aware conditions, not as permanent client-side validation errors
  • when using idempotent flows, retry with the same idempotency key where supported