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

# Pagination

> Every list returns items and a nextCursor. Pass it back as cursor for the next page.

Every list and search operation takes the same two optional fields and returns the same shape.

| Field | In | Meaning |
| - | - | - |
| `limit` | Request | Items per page, 50 by default, at most 100 |
| `cursor` | Request | The `nextCursor` from the previous page. Omit it for the first page |
| `items` | Response | This page |
| `nextCursor` | Response | Pass it back as `cursor` for the next page. `null` on the last page |

```bash theme={null}
curl -X POST https://api.avazal.com/v1/conversations.list \
  -H "Authorization: Bearer $AVAZAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"source": "gmail", "tab": "needs_reply", "limit": 25}'
```

```json theme={null}
{ "items": [ … ], "nextCursor": "eyJ…" }
```

```bash theme={null}
curl -X POST https://api.avazal.com/v1/conversations.list \
  -H "Authorization: Bearer $AVAZAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"source": "gmail", "tab": "needs_reply", "limit": 25, "cursor": "eyJ…"}'
```

Keep going until `nextCursor` is `null`.

## Rules

* Cursors are opaque. Don't parse or build them.
* A cursor belongs to the operation and filters that made it. Send the same filters with it; changing them, or sending a malformed cursor, returns `400` with `_tag: "InvalidCursor"`. Start again without a cursor.
* Each list says its order in its description, such as newest first for `conversations.list` or earliest first for `events.list`. In `messages.list`, each next page goes further back in time.
* Some lists return extra fields beside `items`.

From the CLI, pass the cursor as a flag:

```bash theme={null}
avazal conversations.list --source gmail --tab needs_reply --cursor eyJ…
```


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