Response envelope
All API routes return a consistent JSON envelope. Success (HTTP 2xx):code field is a stable, machine-readable identifier you can use for programmatic error handling. Common codes are listed below.
Common status codes
| Status | Code | Meaning |
|---|---|---|
200 | — | Successful read or mutation. |
400 | VALIDATION_ERROR | Invalid payload or missing required fields. |
401 | UNAUTHORIZED | Authentication missing or invalid. |
403 | FORBIDDEN | Authenticated but insufficient permissions. |
404 | NOT_FOUND | Resource not found. |
409 | CONFLICT | State conflict such as a duplicate handle. |
429 | RATE_LIMITED | Too many requests — back off and retry. |
500 | INTERNAL_ERROR | Unexpected server-side failure. |
Error handling guidance
- Check the top-level
successfield before accessingdata. - Use the
codefield for programmatic branching (e.g. retry onRATE_LIMITED, prompt re-auth onUNAUTHORIZED). - Treat writes as retriable only when idempotency is guaranteed by the route.
- Surface the
errormessage in client logs for operational debugging.
