# Paginate list responses

Use cursors, limits, filters, sorting, includes, and search on dimmi REST API list endpoints.

List endpoints return a `data` array and a `meta` object. To fetch the next page, pass `meta.next_cursor` as `cursor`.

```bash
curl -G https://trydimmi.com/api/v1/conversations \
  -H "Authorization: Bearer <api_token>" \
  --data-urlencode "limit=50" \
  --data-urlencode "filter[status]=open,snoozed" \
  --data-urlencode "sort=-last_message_at" \
  --data-urlencode "cursor=<next_cursor>"
```

Omit `cursor` on the first request, and swap `<api_token>` for your [API token](/developers/api/authentication/).

## Query parameters

| Parameter | Format | What it does |
| --- | --- | --- |
| `limit` | Integer | Items per page. Default `25`, max `100`. |
| `cursor` | String | `meta.next_cursor` from the previous page. |
| `filter[<field>]` | Comma-separated values | Matches items with any listed value. |
| `sort` | Comma-separated fields | Ascending by default; prefix `-` for descending. |
| `include` | Comma-separated names | Embeds related records on each item. |
| `q` | String | Search query. |

Check each endpoint in the [API reference](/api-reference/) for its supported filters, sorts, and includes. A few endpoints use `offset`, `after`, or `page` instead of `cursor`.

## Response `meta` fields

| Field | Value |
| --- | --- |
| `next_cursor` | Cursor for the next page, or `null` on the last page. |
| `prev_cursor` | Cursor for the previous page, or `null`. |
| `per_page` | Effective `limit` applied by dimmi. |
| `total` | Total matching items (present on endpoints that compute totals). |

## Pagination errors

Invalid list parameters return `400` and name the bad input in `parameter`:

| Code | Cause |
| --- | --- |
| `invalid_limit` | `limit` is outside `1` to `max` (returned in the response). |
| `invalid_cursor` | Cursor is malformed or tampered with. |
| `invalid_filter` | Filter field is not supported on this endpoint. |
| `invalid_sort` | Sort field is not supported on this endpoint. |
| `invalid_include` | Include name is not supported on this endpoint. |

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
