> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brandgate.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

> Walk through lists with a cursor.

Every list endpoint returns the same shape, sorted by `updated_at` and then `id`, oldest change first:

```json theme={null}
{
  "object": "list",
  "data": [ … ],
  "has_more": true,
  "next_cursor": "eyJ1IjoiMjAyNi0xMC0yMFQwODoxNTowMFoiLCJpIjoi…"
}
```

| Parameter | Meaning |
| - | - |
| `limit` | 1 to 100, default 50 |
| `cursor` | The `next_cursor` from the previous page |
| `updated_since` | Only objects changed at or after this ISO 8601 time |

Pass the same filters together with `cursor` on every page. Stop when `has_more` is `false`.

The cursor is opaque: do not build or parse it yourself. It stays valid indefinitely because it points at a position in the sort order, not at a snapshot, so objects that change while you page simply show up again on a later page.

```javascript theme={null}
let cursor = null;
do {
  const url = new URL("https://api.brandgate.dev/v1/products");
  url.searchParams.set("limit", "100");
  if (cursor) url.searchParams.set("cursor", cursor);
  const page = await fetch(url, { headers: { Authorization: `Bearer ${key}` } }).then((r) => r.json());
  for (const product of page.data) await upsert(product);
  cursor = page.next_cursor;
} while (cursor);
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.