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

# Pagination

> List endpoints return data, links and meta. Page with ?page and size with ?per_page.

Every list endpoint is paginated. Responses have the same three-part shape:

```json theme={"dark"}
{
  "data": [ { "id": "…", "name": "Ada Lovelace" } ],
  "links": {
    "first": "https://dash.dmly.io/api/v1/contacts?page=1",
    "last":  "https://dash.dmly.io/api/v1/contacts?page=9",
    "prev":  null,
    "next":  "https://dash.dmly.io/api/v1/contacts?page=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "to": 25,
    "per_page": 25,
    "last_page": 9,
    "total": 213
  }
}
```

## Parameters

| Parameter  | Default | Notes                             |
| ---------- | ------- | --------------------------------- |
| `page`     | `1`     | The page to fetch                 |
| `per_page` | `25`    | Items per page. **Capped at 100** |
| `limit`    | —       | Alias for `per_page`              |

Asking for more than 100 is not an error — the value is silently clamped to 100. Read
`meta.per_page` if you need to know what you actually got.

```bash theme={"dark"}
curl "https://dash.dmly.io/api/v1/contacts?per_page=100&page=2" \
  -H "x-api-key: dmly_xxxxxxxxxxxx"
```

## Walking every page

Follow `links.next` until it is `null`. That is more robust than incrementing `page`
yourself and comparing against `meta.last_page`, because it stays correct even if the
total shifts while you iterate.

```python theme={"dark"}
url = "https://dash.dmly.io/api/v1/contacts?per_page=100"
headers = {"x-api-key": "dmly_xxxxxxxxxxxx"}

while url:
    r = requests.get(url, headers=headers).json()
    for contact in r["data"]:
        ...
    url = r["links"]["next"]
```

<Tip>
  Use `per_page=100` for bulk reads. Each page costs one request against your
  [rate limit](/api-reference/rate-limits), so larger pages mean fewer requests.
</Tip>

<Note>
  Paginating a list that is changing underneath you can skip or repeat records across
  pages. For a consistent bulk export, narrow the query with a filter that will not move —
  or accept that a small amount of drift is possible.
</Note>
