Skip to main content
Whatever you call, the body is one of five shapes. Learn them once and the rest of the API reads the same way.

A single resource is unwrapped

No data envelope, but always an object discriminator.

A list

Each element carries its own object, so an item lifted out of data still says what it is. See Pagination.

A deletion receipt

Two things are worth knowing before you write the handler:
  • deleted is always true. A failed deletion is an error status with an error body, never a receipt with deleted: false, so a branch on if (!res.deleted) will never run.
  • message is for humans. Show it, log it, but do not parse or compare it — the wording may change, and that is not a breaking change.

An error

The only wrapped form. See Errors.

A bulk result

The only body where successes and failures sit together, and therefore the only one where the HTTP status does not describe the outcome. See Bulk operations.

null and omission in a PATCH

PATCH accepts the same fields as POST, all optional. Leaving a field out and sending it as null mean different things: So an update that should only rename a link carries name and nothing else — sending the full object back with unchanged fields works too, but any field you set to null along the way will be cleared. On a link, two of those nulls move the link rather than empty it: