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

# Pagination

> Page through list endpoints.

All list endpoints are paginated: `GET /servers`, `GET /invoices`, `GET /ssh-keys`, `GET /locations`, `GET /plans` and `GET /images`.

## Query Parameters

| Parameter | Default | Range |
| - | - | - |
| `page` | `1` | 1 to 100000 |
| `per_page` | `20` | 1 to 100 |

Out of range returns `422 validation_error`.

```bash theme={null}
curl "https://api.arct.cloud/v1/servers?page=2&per_page=50" \
  -H "Authorization: Bearer $ARCT_TOKEN"
```

## Response

```json theme={null}
{
  "data": [{"id": "4f6c2a8e-1d3b-4c5a-9e7f-0b2d4c6e8a1f"}],
  "pagination": {
    "page": 2,
    "per_page": 50,
    "total": 51,
    "total_pages": 2
  }
}
```

* A page past the end returns an empty `data`.
* An empty list has `total_pages` `0`.
* Single resources aren't wrapped in `data`.

To fetch all, increase `page` up to `pagination.total_pages`.


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