Skip to main content

The error envelope

Every non-2xx response uses the same shape. Only error is always present; the remaining fields appear when they add something useful.
string
A stable machine-readable code, for example insufficient_scope. Branch on this, not on the human-readable text.
string
A human-readable explanation, safe to log.
string
A shorter human-readable summary, present on some responses.
object
Additional structured context — for validation failures, typically the offending fields.
string
On 403, the scope this endpoint needs.
array
On 403, the scopes your token actually holds.

Status codes

A 404 does not always mean the record is absent — responses are scoped to what the acting user may see, so a record outside their permissions is indistinguishable from one that does not exist.

Worked examples

A plain-text Tenant Unknown body, rather than the JSON envelope above, means the request never reached the API. The zivio-tenant-id header is missing or does not match a Zivio organisation, and it is checked before your token is.Your token and scopes are not the problem here. See Identifying your organisation.
Request a fresh token and retry. Retry once only — a second 401 means the credentials or the Authorization header are wrong, not the token’s age.
Retrying will not help — the token needs to be issued with projects:read. See Scopes.
Workflow endpoints reject actions that do not apply to the record’s current state. For example, submitting a project that is not in draft, or one that fails publish validation.Some 422 responses are actionable rather than fatal: POST /projects/{id}/submit returns error: approver_selection_required together with an approver_selection array listing each step’s eligible approvers, so you can re-submit with approvers populated.

Handling errors well

  • Branch on the error code, never on error_description wording.
  • Retry 401 once after refreshing the token. Do not retry 403 or 422 — they need a different token or a different payload.
  • Log error, error_description and details together; details usually names the exact field at fault.