Pagination
Lists return one page at a time:
{ "items": [ { "id": "…" }, { "id": "…" } ], "next_cursor": "eyJpZCI6IjAxYTIuLi4ifQ"}limitsets the page size: 25 by default, at most 100.next_cursoris there when there’s more. Pass it back ascursorto get the next page, with the same filters.- No
next_cursormeans you’ve reached the end.
Cursors are opaque: don’t build or change them. Newest items come first unless the endpoint says otherwise.
Fetching everything
Section titled “Fetching everything”Node.js
async function* all(path, params = {}) { let cursor; do { const query = new URLSearchParams({ ...params, limit: '100', ...(cursor ? { cursor } : {}) }); const page = await supportaka(`${path}?${query}`); // see the Errors page for this helper yield* page.items; cursor = page.next_cursor; } while (cursor);}
for await (const ticket of all(`/organizations/${org}/products/${product}/tickets`, { status: 'open' })) { console.log(ticket.number, ticket.subject);}Python
def all_items(path, **params): cursor = None while True: query = {**params, "limit": 100, **({"cursor": cursor} if cursor else {})} page = session.get(f"{api}{path}", params=query).json() yield from page["items"] cursor = page.get("next_cursor") if not cursor: break
for ticket in all_items(f"/organizations/{org}/products/{product}/tickets", status="open"): print(ticket["number"], ticket["subject"])A few endpoints return everything at once instead, such as the list of products ({ "products": [...] }) and a ticket’s messages. The API reference shows each response’s shape.