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

# Pagination

> Page through list endpoints with cursor-based pagination

Every list endpoint returns results in pages using cursor-based pagination. Cursors are
object IDs, so paging stays stable even when objects are added or removed between
requests.

## Response Structure

List responses wrap results in a `data` array alongside a `pagination` object:

```json List response theme={null}
{
  "data": [
    { "id": "snk_01kpb4n7arexs9cjf0ffmdtjry" }
  ],
  "pagination": {
    "starting_after": null,
    "limit": 10,
    "has_more": true,
    "next_cursor": "snk_01kpb4n7arexs9cjf0ffmdtjry"
  }
}
```

| Field            | Description                                                        |
| ---------------- | ------------------------------------------------------------------ |
| `starting_after` | The cursor this page was fetched with (`null` for the first page). |
| `limit`          | Number of results per page.                                        |
| `has_more`       | Whether more results exist after this page.                        |
| `next_cursor`    | Cursor to pass as `starting_after` for the next page.              |

## Query Parameters

| Parameter        | Type    | Default | Description                                             |
| ---------------- | ------- | ------- | ------------------------------------------------------- |
| `limit`          | integer | 10      | Results per page (1–50).                                |
| `starting_after` | string  | —       | Cursor: the ID of the last object on the previous page. |

## Paging Through Results

Omit `starting_after` to fetch the first page. For each subsequent page, pass the previous
response's `next_cursor` as `starting_after`. Stop when `has_more` is `false`, at which
point `next_cursor` is `null`.

<Steps>
  <Step title="Fetch the first page">
    ```bash First page theme={null}
    curl "https://api.demo.cula.earth/tracking/v1/sinks?limit=20" \
      -H "Authorization: Bearer your_access_token_here" \
      -H "Cula-Organisation-Id: org_01k6cvp6bdeayb0hfrghfwxjzx"
    ```
  </Step>

  <Step title="Fetch the next page">
    Pass the previous response's `next_cursor` as `starting_after`:

    ```bash Next page theme={null}
    curl "https://api.demo.cula.earth/tracking/v1/sinks?limit=20&starting_after=snk_01kpb4n7arexs9cjf0ffmdtjry" \
      -H "Authorization: Bearer your_access_token_here" \
      -H "Cula-Organisation-Id: org_01k6cvp6bdeayb0hfrghfwxjzx"
    ```
  </Step>
</Steps>
