Skip to content

The paginated envelope is a third envelope, with four fixed pagination keys

Two envelopes carry a result and a refusal. A paginated result is a third, and its pagination block belongs to the envelope rather than to the rows it sits beside.

The rule

Normative: this is the rule
  1. Alongside {success, data} and {success, error}, a response paginated by offset MUST be {success, data, pagination}.
  2. data MUST be an array holding one element per row of the page.
  3. pagination MUST carry total, limit, offset and has_more, and nothing else: its members are a closed list, because one block is shared by every paginated endpoint, and a member one endpoint adds would make it that endpoint's own block.
  4. has_more MUST be page arithmetic, (offset + limit) < total, and not a second query.
  5. It MUST be spelled has_more in every response paginated by offset, whatever the spelling convention of that endpoint's rows.
  6. It belongs to the shared envelope, and an implementation MUST NOT rename it to match the rows beside it.
  7. An endpoint paginated by offset MUST NOT build a pagination block of its own.
  8. A cursor-paged endpoint, such as the message poll (PLAY-3), is not paginated by offset.

What it means

A result and a refusal are the two envelopes every endpoint already answers in. A paginated result is a third, and it is a shape of its own, not the result envelope with a block appended by whichever endpoint happens to return one: the same four keys on every paginated endpoint, and only those four. data is the page itself, an array with one element per row, never an object that wraps the rows under a name of the endpoint's choosing: a client reads every paginated answer's rows from the same place. Lists in this specification are open unless a rule closes them; this one is closed, because a key that one endpoint adds turns the shared block into that endpoint's own, and a client could no longer read every paginated answer the same way.

has_more is arithmetic the endpoint itself can do — whether the offset and limit it just reported would still leave rows unseen — not a second query run to find out. And it keeps its snake_case spelling regardless of the casing convention the rows beside it use: the block belongs to the shared envelope, not to the endpoint it happens to sit in, so no endpoint renames it to match its own rows or builds a pagination block of its own.

Example

Two workflows, unfiltered: three keys, and the pagination block reports the whole set (rows elided).

A list endpoint with two rows200 — paginated
GET /api/flowdrop/workflows

{"success": true, "data": [ … ], "pagination": {"total": 2, "limit": 50, "offset": 0, "has_more": false}}

The same four keys sit beside rows spelled the other way.

A list endpoint whose rows are spelled the other way200 — paginated
GET /api/flowdrop/workflows/{workflow_id}/playground/sessions

{"success": true, "data": [ … ], "pagination": {"total": 1, "limit": 50, "offset": 0, "has_more": false}}

has_more is spelled the same both times: once beside rows spelled the same way as the pagination block, once beside rows that are not.

Why

Recorded under OPEN-22, OPEN-23, OPEN-25, OPEN-45, OPEN-54.

Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · API-5 · changed in spec 1.1