Skip to main content

Single resources are top-level

Every single-resource response returns the resource’s fields at the top level - there is no wrapper key. This applies uniformly to collections, units, chips, taps, session-token introspection, claims, transfers, and chip replacements.
Earlier versions of this API wrapped single collection and unit responses in a collection / unit envelope ({ "collection": {...} }). That envelope is gone - if your integration reads response.collection.id from GET /v1/collections/{id} or response.unit.id from GET /v1/units/{id}, update it to read the fields at the top level.
Some top-level responses contain a nested resource as a field - for example, the tap response includes the verified unit, and the chip-pair response includes a unit snapshot. That nesting is part of the resource’s own shape, not an envelope. For example, creating a collection and then polling it:
And recording a tap:
These examples use fetch deliberately, to show the shapes on the wire. @endstate-sdk/core preserves them exactly - it renames nothing, so created.id, polled.contract.status, and tap.session_token.token are the same paths in TypeScript.

List responses

List endpoints wrap their array under a plural key alongside pagination:
See Pagination for cursoring through results.

Errors

Errors use a separate, uniform envelope - { "error": { "code", "message", "request_id" } } - across every endpoint. See Errors.