Skip to main content

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 in data alongside a meta object:

Success envelope (list with pagination)

List endpoints return an array in data and include a pagination object:

204 No Content

DELETE endpoints return 204 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 the error object:

Key fields

Status codes

Success codes

Error codes

Implementation tips

  • Branch on error.code, not error.message. The code value is stable across releases; message text may change.
  • Treat error.details as optional. Not every error includes field-level detail. Always check for its presence before iterating.
  • Handle both 200 and 201 on success. Creation endpoints return 201; most other writes return 200. 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.