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.{ 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; theerror code tells you the specifics.
Error codes
These are everyerror 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.
x-request-id header, we echo it back so the id survives across your
own hops.