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

# Pagination

> How list endpoints page through results

List endpoints return at most **10 items per page** by default and wrap results in a pagination envelope.
There are two envelope styles depending on the endpoint.

## Offset pagination

Used by high-volume list endpoints — **Contacts**, **Conversations**, and a conversation's **Messages**.
The response includes a total `count` and absolute `next` / `previous` URLs:

```json theme={null}
{
  "count": 342,
  "next": "https://api.algosmiths.com/api/v1/contacts/?limit=10&offset=10",
  "previous": null,
  "results": [ /* ... up to `limit` items ... */ ]
}
```

Control the window with two query parameters:

| Parameter | Default | Notes                                                          |
| --------- | ------- | -------------------------------------------------------------- |
| `limit`   | `10`    | Items per page. **Capped at 200** — larger values are clamped. |
| `offset`  | `0`     | Index of the first item to return.                             |

The simplest way to page is to follow the `next` URL until it's `null`.

## Cursor pagination

Used by **Templates** and other list endpoints. Cursor pagination is more stable when the underlying data
changes between requests, so it does **not** include a `count`:

```json theme={null}
{
  "next": "https://api.algosmiths.com/api/v1/templates/?cursor=cD0yMDI2LTA3LTEy",
  "previous": null,
  "results": [ /* ... up to 10 items ... */ ]
}
```

Don't construct the `cursor` value yourself — treat it as opaque and follow the `next` URL. When `next` is
`null`, you've reached the end.

<Info>
  Because cursor responses omit `count`, you can't know the total number of results up front — page until
  `next` is `null`. Ordering is newest-first (by creation time).
</Info>
