Skip to main content
Every error response on the REST API, from a 400 to a 500, is a JSON object with a stable error code, so a client that .json()s every response never breaks on an error.
Branch on the stable error code, never on the human-readable message (which may be reworded at any time). asset is present only on asset-scoped errors.
Every JSON error uses the { error, message, asset? } envelope above. Some codes add route-specific keys next to message, mostly on the receipt-ledger routes under /v1/audit: hint, got, valid, max_days, alert_id, detail or commit_status. Treat those extra keys as optional and branch on error. The one non-JSON error is the WebSocket handshake: when the per-IP connection cap is reached, GET /v1/ws answers 429 with the plain-text body too many ws connections.

Status codes

The HTTP status tells you the class; the error code tells you the specifics.

Error codes

These are every error code the API emits today. New codes may be added; existing codes are not renamed within /v1.

Any endpoint

Assets and peg feed (/v1/assets/*, /v1/peg/feed/*)

Receipt ledger (/v1/audit*)

GET /v1/audit/{alert_id} also answers 202 (receipt persistence pending, retry after retry_after_seconds) and 410 (persistence failed permanently). Those are not errors in the table above; see the REST API guide.

Debugging with x-request-id

Every response (success or error) carries an x-request-id header. When something looks wrong, grab it and include it in your report — it lets us trace the exact request.
If you send your own x-request-id header, we echo it back so the id survives across your own hops.