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

# Pagination

Use list endpoints by making an initial request with your filters and an optional `limit`, then following the page URLs returned by the API.

<Panel>
  <RequestExample>
    ```bash cURL theme={null}
    curl -G https://api.chargeapi.co/v1/policies \
      -H "Authorization: Bearer ch_sk_test_..." \
      -d status=active \
      -d limit=10
    ```
  </RequestExample>

  <ResponseExample>
    ```json Response theme={null}
    {
        "data": [
            {
                "id": "pol_hbyAN9SMUkmo8AD0bk10VD27dOK0gqah",
                "object": "policy",
                "created": "2026-04-01T00:17:55.220Z",
                "mode": "enforcement",
                "name": "Example Policy",
                "rules": {
                    "allowed_operators": ["example_operator"],
                    "max_price_per_kwh": 25,
                    // ...
                },
                "status": "active"
            }
        ],
        "next_page_url": "https://api.chargeapi.co/v1/policies?page=page_MHyulbAysB6BGMUs3AFd85UXM2nM5x1F86hzmpqo3uQ&status=active&limit=10",
        "previous_page_url": null
    }
    ```
  </ResponseExample>
</Panel>

Charge paginates top-level list endpoints with opaque page URLs. You make the first request with any supported filters and an optional `limit`, then continue the sequence by requesting the `next_page_url` or `previous_page_url` exactly as returned.

This matters because the `page` token is opaque. Do not construct or mutate page tokens manually. Once a pagination sequence starts, keep following the returned URLs until you reach the end of the result set.

Do not change filters after the first request in a pagination sequence.

## Follow returned page URLs

When the response includes `next_page_url`, request that URL exactly as returned.

```bash cURL theme={null}
curl "https://api.chargeapi.co/v1/policies?page=page_MHyulbAysB6BGMUs3AFd85UXM2nM5x1F86hzmpqo3uQ&status=active&limit=10" \
  -H "Authorization: Bearer ch_sk_test_..."
```

If a later response includes `previous_page_url`, use it the same way. In both directions, the safest client behavior is to treat the returned URL as the complete instruction for the next request.

## Parameters

<ParamField query="limit" type="integer">
  Maximum number of objects to return (default 10).

  Allowed range: `1` to `100`.
</ParamField>

<ParamField query="page" type="string">
  Page token from a previous list response. Use it only by following `next_page_url` or `previous_page_url`.
</ParamField>

## Attributes

<ResponseField name="data" type="array" required>
  List of objects returned for the current page.
</ResponseField>

<ResponseField name="next_page_url" type="string | null" required>
  URL for the next page of results, or `null` when there is no next page.
</ResponseField>

<ResponseField name="previous_page_url" type="string | null" required>
  URL for the previous page of results, or `null` when there is no previous page.
</ResponseField>
