Errors and failure handling

Interpret the stable error envelope and decide whether to correct, reload, reconcile, or stop.

Last updated: 9/13/2026

API failures use a stable JSON envelope. Messages are safe for display, while the request ID is the correlation value to include in a support report.

JSON
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed",
    "requestId": "req-123"
  }
}

Response strategy

StatusMeaningCaller action
400Request validation failedCorrect the declared parameters, headers, or body.
401Authentication or session bootstrap is requiredRefresh the Privy session and bootstrap if needed.
403The authenticated caller lacks authorityStop; do not retry under the same authority.
404The resource is unavailable in the authorized scopeConfirm the organization and resource identifiers.
409Version, state, or idempotency conflictReload current state and reconcile the intended action.
422Deterministic policy refused the actionShow the refusal; model output cannot override it.
429A bounded quota was reachedRespect the response and retry policy.
503A required dependency is unavailableBack off and reconcile before retrying a mutation.

Do not parse message text to decide control flow. Branch on the HTTP status and stable error.code, and log only the request ID plus sanitized application context.