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

# Pagination, filtering & sorting

> How Delogue API list endpoints paginate, filter, and sort.

List endpoints accept filtering, sorting, and pagination as **query parameters** on the
collection root (e.g. `GET /api/colors?state=active&pageSize=30`).

## Two pagination modes

Pagination has two mutually exclusive modes on the same endpoint:

<Tabs>
  <Tab title="Page-based">
    Use `pageSize` and `pageNumber` together with any `filter` and `sort`:

    ```http theme={"dark"}
    GET /api/colors?state=active&pageSize=30&pageNumber=2
    ```
  </Tab>

  <Tab title="Cursor">
    Pass the `cursor` returned by the previous response. The cursor already encodes the
    filter and sort that produced it:

    ```http theme={"dark"}
    GET /api/colors?cursor=eyJTaWduYXR1cmUiOi...
    ```
  </Tab>
</Tabs>

<Warning>
  `cursor` is mutually exclusive with `pageNumber`, `pageSize`, `filter`, and `sort`.
  Sending `cursor` together with any of those returns **400 Bad Request**.
</Warning>

## The pagination object

List responses include a `pagination` block:

```json theme={"dark"}
{
  "pagination": {
    "hasMore": true,
    "cursor": "eyJTaWduYXR1cmUiOi..."
  }
}
```

To fetch the next page, send the returned `cursor` back on the same endpoint.

## Filtering

As much as possible, every field in the response is available as a query-parameter
filter, and filter values match the format returned in responses (e.g. `state=active`,
not `state=1`).
