ConceptsPagination

Pagination

How list endpoints page, for Koil resources and provider 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:

curl "https://api.koil.co/v1/backfill-requests?connectedProfileId=cp_123&limit=1" \  -H "Authorization: Bearer $KOIL_API_KEY"
200 response
{  "data": [    {      "backfillRequestId": "bf_2Jd8kQm4ZtPw7XcR1nVb",      "connectedProfileId": "cp_123",      "contentType": "instagram.media.items",      "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",      "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.

curl "https://api.koil.co/v1/backfill-requests?connectedProfileId=cp_123&limit=1&cursor=WyIyMDI2LTA3LTAxVDEwOjAwOjAwLjAwMFoiLCJiZl8ySmQ4a1FtNFp0UHc3WGNSMW5WYiJd" \  -H "Authorization: Bearer $KOIL_API_KEY"

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

  • Koil resources — Connected Profiles, Auth Integrations, publish requests, backfill requests — page newest first. A cursor stays valid when the item it was taken from is deleted, so a page walk is never cut short. Connections are returned in one response, without paging.
  • Provider content (GET /v1/content/{contentType}) pages through the provider's own cursor, which Koil passes through as nextCursor. Page sizes and ordering follow the provider; each content type's list on its provider's page says what it returns.

Each list endpoint's accepted limit range and filters are on its page in the API endpoints reference.