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

# Pagination

> How to paginate list endpoints in the KPI Integration API

List endpoints (for example, listing campaigns or jobs) support page-number pagination via query
parameters.

## Query parameters

| Parameter  | Type    | Description                                                       |
| ---------- | ------- | ----------------------------------------------------------------- |
| `page`     | integer | Page number to retrieve. Defaults to `1`.                         |
| `per_page` | integer | Items per page. One of `10`, `20`, `50`, `100`. Defaults to `10`. |

```bash theme={null}
curl "https://api.kpi.ms/integration/v1/client/campaigns?page=2&per_page=20" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Response shape

Paginated responses return a `meta` object alongside `data`:

```json theme={null}
{
  "data": [ ... ],
  "meta": {
    "current_page": 2,
    "per_page": 20,
    "total": 87,
    "last_page": 5
  }
}
```

| Field          | Description                                    |
| -------------- | ---------------------------------------------- |
| `current_page` | The page returned in this response.            |
| `per_page`     | Items per page, as requested (or the default). |
| `total`        | Total number of items across all pages.        |
| `last_page`    | The last page number available.                |

To fetch subsequent pages, increment `page` until it exceeds `meta.last_page`.

A `page` value below `1`, or a `per_page` value outside the supported list (`10`, `20`, `50`, `100`),
returns a `422 Unprocessable Entity` — see [Error Handling](/error-handling) for the error shape.
