Response envelopes
Every response from the CaseXchange Public API uses a consistent envelope so clients can parse success and error cases with minimal branching.Success envelope (single resource)
Endpoints that return a single resource wrap it indata alongside a meta object:
Success envelope (list with pagination)
List endpoints return an array indata and include a pagination object:
204 No Content
DELETE endpoints return204 No Content with no response body. Clients should treat any 2xx without a body as a successful deletion.
Error envelope
All error responses share a single shape built around theerror object:
Key fields
Status codes
Success codes
Error codes
Implementation tips
- Branch on
error.code, noterror.message. Thecodevalue is stable across releases;messagetext may change. - Treat
error.detailsas optional. Not every error includes field-level detail. Always check for its presence before iterating. - Handle both
200and201on success. Creation endpoints return201; most other writes return200. Accept any 2xx as success. - Preserve unknown fields. If you proxy or log payloads, do not strip unrecognized keys. The schema may add new fields in future releases without a version bump.