SynqedDocs

Pagination

Cursor-based pagination on every list endpoint.

The resource list endpoints — /v1/documents, /v1/memories, and the record lists (/v1/tickets, /v1/prs, …) — return newest records first, in a list envelope:

{
  "object": "list",
  "data": [ { "id": "…", "object": "ticket", "…": "…" } ],
  "has_more": true,
  "next_cursor": "WzE3NjA0…"
}

Pass next_cursor back as cursor to fetch the next page, and stop when has_more is false:

let cursor: string | undefined;
do {
  const url = new URL('https://api.synqed.dev/v1/tickets');
  url.searchParams.set('limit', '100');
  if (cursor) url.searchParams.set('cursor', cursor);
  const page = await fetch(url, { headers }).then((r) => r.json());
  for (const ticket of page.data) handle(ticket);
  cursor = page.has_more ? page.next_cursor : undefined;
} while (cursor);
  • limit is 1–100 (default 25).
  • Cursors are opaque — don't build or parse them.
  • GET /v1/agents returns up to 200 agents and GET /v1/rules up to 500 rules, in one response. GET /v1/messages returns up to 200 messages oldest-first with has_more and a next_cursor; pass next_cursor as cursor to continue (or to poll for new messages).
  • Because records outside the key's data access are skipped, a page can occasionally hold fewer than limit items while has_more is still true. Keep paging until has_more is false.