DisputelyDocs

Pagination

Cursor-based pagination on every list endpoint.

All list endpoints paginate the same way:

ParamNotes
limitDefault 50, max 100.
cursorOpaque string. Pass next_cursor from the previous page. Omit on page 1.

Every list response is wrapped in the same envelope:

{
  "data": [ ... ],
  "next_cursor": "eyJjcmVhdGVkQXQiOiIyMDI2LTA5LTMw...",
  "has_more": true
}

Keep requesting with cursor=next_cursor until has_more is false (next_cursor will be null).

let cursor = null;
const all = [];

do {
  const url = new URL('https://api.disputely.com/v1/alerts');
  url.searchParams.set('limit', '100');
  if (cursor) url.searchParams.set('cursor', cursor);

  const res = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.DISPUTELY_API_KEY}` },
  });
  const page = await res.json();

  all.push(...page.data);
  cursor = page.next_cursor;
} while (cursor);

Results are ordered newest first, with a stable tiebreak, so pages never skip or repeat items.

Cursors expire after 24 hours. If you get 400 invalid_cursor, restart from page 1. The cursor is opaque — don't parse or store it long-term.