View as Markdown

Pagination

Cursor pagination on the native /v1 lists, and which lists keep their upstream shapes.

The native /v1 lists return one page at a time and hand you a cursor for the next one.

Request and response

QueryMeaning
limitPage size, 1 to 500. Default 100.
cursorThe next_cursor from the previous page, passed back unchanged. Omit it for the first page.

Every page carries the list’s items plus:

FieldMeaning
has_moretrue when another page follows.
next_cursorThe cursor for the next page, or null on the last page.
curl -s "https://api.tickwire.io/v1/pretrade-holds?status=pending&limit=2" -H "X-API-Key: $TW_KEY"
{
  "data": [{ "hold_id": "hld_2", "status": "pending" }, { "hold_id": "hld_1", "status": "pending" }],
  "has_more": true,
  "next_cursor": "eyJ2IjoxLCJmIjoi…"
}

Call again with cursor=eyJ2IjoxLCJmIjoi… and the same filters until has_more is false.

Guarantees

  • Keyset, not offset. A page never repeats or skips an item because rows were added or removed between calls. Each list has a fixed order, documented on its route.
  • Cursors are opaque and bound to their list and filters. A cursor that was edited, comes from another list, or is sent with different filters is rejected with 400 invalid_cursor. Start again without a cursor.
  • A cursor reveals nothing about other tenants; every query is still scoped to your key.

Which lists are paginated

ListItems fieldOrder
GET /v1/agent-keysdataOldest first
GET /v1/pretrade-hooksdataOldest first
GET /v1/pretrade-holdsdataNewest first
GET /v1/agent-kill-switchesaccountsBy account id
GET /v1/agent-audit, GET /v1/agent/auditentriesNewest first (before still works)
GET /v1/connected-appsappsOldest first
GET /v1/agent/accountsaccountsBy account id

The compatible routes (/users/current/…, and /v1/accounts, /v1/webhooks and /mt4|mt5/{id}/…) keep their existing shapes and are not paginated this way. GET /v1/webhooks/{id}/deliveries keeps its existing hasMore and nextCursor fields.

In the SDKs

Python: for page in tw.pages(tw.list_holds, status="pending"): … (also async for on AsyncTickwire). TypeScript: for await (const page of pages((cursor) => tw.listHolds({ cursor }))) ….