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

# Pagination

> How list endpoints return paginated data with links and meta.

List endpoints return paginated responses. Each response includes a `links` object for navigation URLs and a `meta` object with pagination details.

## Example response

```json theme={null}
{
  "data": [...],
  "links": {
    "first": "http://.../api/users/search?page=1",
    "last": "http://.../api/users/search?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": null,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "page": null,
        "active": false
      },
      {
        "url": "http://.../api/users/search?page=1",
        "label": "1",
        "page": 1,
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "page": null,
        "active": false
      }
    ],
    "path": "http://.../api/users/search",
    "per_page": 2,
    "to": null,
    "total": 0
  }
}
```

## Links (top-level)

| Attribute | Description                                                                         |
| --------- | ----------------------------------------------------------------------------------- |
| **first** | URL for the first page. Always present.                                             |
| **last**  | URL for the last page. Always present.                                              |
| **prev**  | URL for the previous page. `null` when on the first page.                           |
| **next**  | URL for the next page. `null` when on the last page or when there is only one page. |

Use these URLs to move between pages without building query strings yourself.

## Meta

| Attribute         | Description                                                                             |
| ----------------- | --------------------------------------------------------------------------------------- |
| **current\_page** | 1-based index of the current page.                                                      |
| **from**          | 1-based index of the first item on the current page. `null` when the page has no items. |
| **last\_page**    | Total number of pages.                                                                  |
| **path**          | Base URL of the endpoint (without `page` or other query params).                        |
| **per\_page**     | Number of items per page (page size).                                                   |
| **to**            | 1-based index of the last item on the current page. `null` when the page has no items.  |
| **total**         | Total number of items across all pages.                                                 |

## Meta.links

`meta.links` is an array of page navigation entries. Each entry has:

| Attribute  | Description                                                                              |
| ---------- | ---------------------------------------------------------------------------------------- |
| **url**    | Full URL for that page, or `null` when the link is disabled (e.g. "Previous" on page 1). |
| **label**  | Display label (e.g. `"1"`, `"« Previous"`, `"Next »"`).                                  |
| **page**   | Page number, or `null` for prev/next links.                                              |
| **active** | `true` for the current page, `false` otherwise.                                          |

Use `meta.links` to render a page navigator (e.g. « Previous, 1, 2, 3, Next ») and `meta.total` / `meta.last_page` to show “Page X of Y” or “Showing N of M results”.
