# Pagination

> How list endpoints page, for Koil resources and platform content alike.

Every paginated list returns a page of results in `data`, whether there is more in `hasMore`, and — when there is — a `nextCursor` to fetch it. Pass `limit` for the page size:

```bash
curl "https://api.koil.co/v1/backfill-requests?profileId=prof_123&limit=1" \
  -H "Authorization: Bearer $KOIL_API_KEY" \
  -H "Koil-Version: 2026-12-08"
```

200 response

```json
{
  "data": [
    {
      "kind": "backfill_request",
      "mode": "live",
      "id": "bf_2Jd8kQm4ZtPw7XcR1nVb",
      "profileId": "prof_123",
      "collection": "instagram.media.posts",
      "since": "2026-06-01T00:00:00.000Z",
      "maxItems": 1000,
      "status": "completed",
      "stopReason": "reached_since",
      "emitted": 212,
      "fetched": 240,
      "skipped": 28,
      "oldestEmittedAt": "2026-06-01T08:14:03.000Z",
      "startedAt": "2026-07-01T10:00:01.000Z",
      "completedAt": "2026-07-01T10:02:37.000Z",
      "metadata": {},
      "createdAt": "2026-07-01T10:00:00.000Z",
      "updatedAt": "2026-07-01T10:02:37.000Z"
    }
  ],
  "nextCursor": "WyIyMDI2LTA3LTAxVDEwOjAwOjAwLjAwMFoiLCJiZl8ySmQ4a1FtNFp0UHc3WGNSMW5WYiJd",
  "hasMore": true
}
```

For the next page, pass `cursor` set to the previous page's `nextCursor`, with the same filters. Keep going until `hasMore` is `false`; the last page has no `nextCursor`.

```bash
curl "https://api.koil.co/v1/backfill-requests?profileId=prof_123&limit=1&cursor=WyIyMDI2LTA3LTAxVDEwOjAwOjAwLjAwMFoiLCJiZl8ySmQ4a1FtNFp0UHc3WGNSMW5WYiJd" \
  -H "Authorization: Bearer $KOIL_API_KEY" \
  -H "Koil-Version: 2026-12-08"
```

A cursor is opaque: pass it back exactly as you received it. A malformed one is refused with `validation_error`.

-   **Koil resources** — Connections, Profiles, Apps, publish requests, backfill requests, Event Destinations — page newest first. A cursor stays valid when the item it was taken from is deleted, so a page walk is never cut short.
-   **Platform content** (`GET /v1/profiles/{profileId}/content/{collection}`) pages through the platform's own cursor, which Koil passes through as `nextCursor`. Page sizes and ordering follow the platform; each collection's `list` on its [platform's page](https://docs.koil.co/platforms) says what it returns.
-   **Eligible profiles** (`GET /v1/connections/{connectionId}/eligible-platform-profiles`) page through the platform's own account listings (Facebook Pages, a Business Profile chain's locations, LinkedIn Pages), so ordering follows the platform. A page can hold fewer than `limit` profiles, even none, while `hasMore` is `true`, so keep going until `hasMore` is `false` rather than stopping at a short page.

Each list endpoint's accepted `limit` range and filters are on its page in the [API endpoints](https://docs.koil.co/openapi/publish-requests/v1-publish-requests-get) reference.
