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

# Pagination

> Paginate through lists with cursors.

List endpoints that can return many items, such as conversations, messages, contacts, and knowledge base sources, return results one page at a time. Each page says whether there are more results and includes a cursor for the next page.

## List format

```json theme={null}
{
  "object": "list",
  "data": [
    { "object": "contact", "id": "c7a1f9e2-4b3d-4e8a-9f1c-2d6b8e0a5f34", ... },
    { "object": "contact", "id": "0b9d3c4e-7f21-4a6b-8c5d-e3f1a2b4c6d8", ... }
  ],
  "has_more": true,
  "next_cursor": "eyJpdiI6IjNkY2Y0..."
}
```

| Field | Type | Description |
| - | - | - |
| `object` | string | Always `list`. |
| `data` | array | The items on this page, in the list's order. |
| `has_more` | boolean | Whether there are more results after this page. |
| `next_cursor` | string or null | The cursor for the next page, passed as `cursor`. `null` on the last page. |

## Parameters

| Parameter | Description |
| - | - |
| `limit` | The maximum number of items to return, from 1 to 100. Defaults to 20. Some lists have a lower maximum, such as knowledge base sources with their content. Each list's reference shows its limit. |
| `cursor` | A cursor for pagination. Pass the `next_cursor` from the previous page. Omit it for the first page. |

To fetch the next page, repeat the request with `cursor` set to `next_cursor` and the same filters. You can change `limit` between pages.

Analytics rankings, such as [List countries](https://docs.chatling.ai/api-reference/v3/analytics/list-analytics-countries.md), are the exception: keep the same `limit` on every page. They're ranked by count, so a row can move to another page if the data refreshes while you paginate.

```bash theme={null}
curl "https://api.chatling.ai/v3/contacts?agent_id=AGENT_ID&limit=50" \
  -H "Authorization: Bearer API_KEY"

curl "https://api.chatling.ai/v3/contacts?agent_id=AGENT_ID&limit=50&cursor=NEXT_CURSOR" \
  -H "Authorization: Bearer API_KEY"
```


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