Pagination

How to page through list endpoints.

Last updated: July 2, 2026

Summary

List endpoints support page-based pagination with page and limit. Object API list endpoints and POST /v2/public/records/query also support cursor pagination for stable incremental syncs.Use cursor pagination when you are syncing many records or polling for changes. Use page-based pagination for small user-facing screens where a user needs a specific page number.

Cursor pagination

Cursor pagination uses a stable order by updated_at, id or created_at, id. Start with a supported date sort and a limit:
cURL
curl -X GET "https://api.sanka.com/v2/public/items?limit=100&sort=updated_at" \
  -H "Authorization: Bearer <api_key>"
If more records are available, read meta.pagination.next_cursor from the response and pass it to the next request:
cURL
curl -X GET "https://api.sanka.com/v2/public/items?limit=100&cursor=<next_cursor>" \
  -H "Authorization: Bearer <api_key>"
The cursor stores the sort field and direction, so the next request can omit sort. If you send sort with a cursor, it must match the cursor.POST /v2/public/records/query accepts the same cursor in the JSON body:
JSON
{
  "object_type": "company",
  "limit": 100,
  "sort": "standard:updated_at:asc",
  "cursor": "<next_cursor>"
}
Keep filters, search terms, object type, and limit consistent while walking a cursor. Do not send page with cursor.

Page parameters

Text
curl -X GET "https://api.sanka.com/v2/public/orders?page=1&limit=50" \
  -H "Authorization: Bearer <api_key>"
  • page: page number
  • limit: items per page

Reading responses

JSON
{
  "success": true,
  "data": {
    "items": []
  },
  "meta": {
    "ctx_id": "ctx_...",
    "pagination": {
      "page": 1,
      "page_size": 50,
      "total": 240,
      "next_cursor": "eyJ2IjoxLCJzb3J0X2ZpZWxkIjoi..."
    }
  }
}
For page-based pagination, fetch another page when page * page_size < total. For cursor pagination, continue while next_cursor is present.