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

# Pagination

> Cursor pagination for every v2 list endpoint. How the { data, hasMore, nextCursor } envelope works and how to page through it.

Every list endpoint in v2 returns the same envelope:

```json theme={null}
{
  "data": [ /* items */ ],
  "hasMore": true,
  "nextCursor": "eyJpZCI6MTIzNH0"
}
```

There are no offsets and no totals. To fetch the next page, pass `nextCursor` back as `?cursor=…`.

## Fields

<ResponseField name="data" type="array" required>
  Items on this page, newest first.
</ResponseField>

<ResponseField name="hasMore" type="boolean" required>
  `true` when a next page exists. When `false`, `nextCursor` is `null`.
</ResponseField>

<ResponseField name="nextCursor" type="string | null" required>
  Opaque cursor for the next page. `null` on the last page. Do not parse or construct cursors yourself — they are only meaningful to the server that issued them.
</ResponseField>

## Page size

List endpoints accept an optional `limit` query parameter. Defaults and maximums are documented per endpoint; a common default is 20 and a common ceiling is 100. If you send a value outside the allowed range you'll get a `400 parameter_invalid`.

## Example

```bash theme={null}
# First page
curl "https://api.pickfu.com/v2/surveys?limit=50" \
  -H "Authorization: Bearer sk_live_your_key_here"

# Next page — pass the previous response's nextCursor
curl "https://api.pickfu.com/v2/surveys?limit=50&cursor=eyJpZCI6MTIzNH0" \
  -H "Authorization: Bearer sk_live_your_key_here"
```

A minimal loop that reads every item:

```ts theme={null}
async function fetchAll(url: string, headers: HeadersInit) {
  const out: unknown[] = [];
  let cursor: string | null = null;
  do {
    const u = new URL(url);
    if (cursor) u.searchParams.set("cursor", cursor);
    const res = await fetch(u, { headers });
    const page = await res.json();
    out.push(...page.data);
    cursor = page.hasMore ? page.nextCursor : null;
  } while (cursor);
  return out;
}
```

Cursors are stable — the same cursor always returns the same next page. Two callers paging the same list will see the same items in the same order.


## Related topics

- [PickFu REST API reference and conventions](/docs/api-reference/introduction.md)
- [PickFu API v2](/docs/api-reference/v2/introduction.md)
- [List tags](/docs/api-reference/tags/list-tags.md)
- [List projects](/docs/api-reference/projects/list-projects.md)
- [List playbooks](/docs/api-reference/playbooks/list-playbooks.md)


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