Response envelope
All JSON endpoints use a standard envelope. SSE streams (text/event-stream) are the only exception.
Success
data field contains the route-specific payload.
Error
Error codes
| Code | HTTP status | Meaning |
|---|---|---|
UNAUTHORIZED | 401 | Authentication missing or invalid. |
NOT_FOUND | 404 | Requested resource does not exist. |
VALIDATION_ERROR | 400 | Invalid payload or missing required fields. |
FORBIDDEN | 403 | Authenticated but lacking permission (e.g. admin-only). |
CONFLICT | 409 | State conflict such as a duplicate handle. |
INTERNAL_ERROR | 500 | Unexpected server-side failure. |
Common status code patterns
200/201: successful read or mutation.400: invalid payload or missing required fields (VALIDATION_ERROR).401: authentication missing or invalid (UNAUTHORIZED).403: insufficient permissions (FORBIDDEN).404: resource not found (NOT_FOUND).409: state conflict (CONFLICT).500: unexpected server-side failure (INTERNAL_ERROR).
Error handling guidance
- Check the top-level
successfield before readingdata. - Use the
codefield for programmatic error handling; useerrorfor display. - Treat all writes as potentially retriable only when idempotency is guaranteed by route semantics.
- Surface
errormessages in client logs for operational debugging.
