Errors & pagination

Response envelopes, pagination, error codes & idempotency

Response envelopes

List endpoints return a page envelope:

1{ "data": [], "page": 1, "pageSize": 25, "total": 42 }

Single-resource endpoints return { "data": { … } }.

Pagination

Query paramMeaningDefaultBounds
page1-based page number1≥ 1
pageSizerows per page251–100

total is the unfiltered count for the current query, so you can compute the page count as ceil(total / pageSize).

Errors

All non-2xx responses share one shape:

1{ "error": { "code": "not_found", "message": "Customer not found." } }
HTTPcodeWhen
400bad_requestMalformed JSON or failed validation.
401unauthorizedMissing/invalid/revoked/expired API key.
403forbiddenThe key lacks the required scope.
404not_foundThe resource doesn’t exist or isn’t in your organization.
409conflictIllegal state (e.g. already assigned).
500internal_errorUnexpected server error.

Cross-organization isolation: an id that belongs to another organization always returns 404 — the API never reveals whether it exists.

Idempotency & side effects

Mutations (/assign, /release) reuse the same atomic, audit-logged services the portal and Ops Copilot use. Re-issuing an assign that already holds is safe; releasing an already-released item is a no-op.