Skip to content

Errors

Public error categories for Cleared REST. Stable enough to branch on; not a dump of internal exceptions.

Maturity: Contract-preview. HTTP status + code pairs below are the vocabulary to implement against.

Categories

HTTPcodeMeaning for integrators
400invalid_requestSchema / validation failure
401unauthorizedMissing, malformed, or revoked key
403forbiddenAuthenticated but scope or actor boundary blocks
404not_foundResource not visible in scope (no existence oracle beyond this)
409conflictIdempotency or state conflict
422gate_deniedGate refuses action (business deny)
429rate_limitedBack off and retry with jitter
503unavailableTemporary; gate callers must deny while unhealthy

Do not parse internal detail strings as contract. Prefer code + HTTP status.

Envelope

Synthetic:

{
 "error": {
 "code": "gate_denied",
 "message": "No live eligibility pass for requested action.",
 "reason_code": "no_live_pass",
 "request_id": "req_synth_001"
 }
}

Examples

Unauthorized

HTTP/1.1 401 Unauthorized
Content-Type: application/json

{
 "error": {
 "code": "unauthorized",
 "message": "Invalid API key.",
 "request_id": "req_synth_002"
 }
}

Gate denied

HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json

{
 "error": {
 "code": "gate_denied",
 "message": "Eligibility check denied.",
 "reason_code": "expired",
 "request_id": "req_synth_003"
 }
}

Some environments return 200 with allowed: false for gate; others use 422 + gate_denied. Your issued OpenAPI pins one. In both cases the business action must not proceed.

Idempotency

Replay of the same Idempotency-Key on create/seal returns the original success body (or a conflict if the key was reused with a different body). Safe to retry create/seal on network failure with the same key.

Was this page clear?