{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Pagination","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"pagination","__idx":0},"children":["Pagination"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["List endpoints support pagination so you can work through large datasets in pages."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-pagination-works","__idx":1},"children":["How Pagination Works"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["iClosed uses ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["page-based pagination"]}," (not offset). Pass ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]}," (zero-based index) and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}," (records per page)."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Default"},"children":["Default"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Zero-based page index. Page 0 = first page, page 1 = second page, etc."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["20"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Records per page. Maximum: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["100"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"endpoints-that-support-pagination","__idx":2},"children":["Endpoints That Support Pagination"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Endpoint"},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Pagination params"},"children":["Pagination params"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Total field"},"children":["Total field"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/eventCalls"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.count"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/fields/objects"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["count"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hasMore"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nextPage"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/deals"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["varies"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/transactions"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["varies"]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"response-shapes","__idx":3},"children":["Response Shapes"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"get-v1eventcalls","__idx":4},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/eventCalls"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": {\n    \"eventCalls\": [ ... ],\n    \"count\": 248\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Calculate whether there are more pages:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"hasMore = (page + 1) * limit < count\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"get-v1fieldsobjects","__idx":5},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/fields/objects"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"count\": 45,\n  \"data\": [ ... ],\n  \"hasMore\": true,\n  \"nextPage\": 1\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hasMore"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nextPage"]}," directly."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"fetching-all-records","__idx":6},"children":["Fetching All Records"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"python--get-v1eventcalls","__idx":7},"children":["Python — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/eventCalls"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import requests\n\nBASE_URL = 'https://public.api.iclosed.io'\nHEADERS  = {'Authorization': 'Bearer iclosed_YOUR_API_KEY'}\n\ndef get_all_calls(event_type='ALL', limit=100):\n    all_calls = []\n    page = 0\n\n    while True:\n        resp = requests.get(\n            f'{BASE_URL}/v1/eventCalls',\n            headers=HEADERS,\n            params={'eventType': event_type, 'limit': limit, 'page': page}\n        )\n        resp.raise_for_status()\n        body = resp.json()['data']\n\n        all_calls.extend(body['eventCalls'])\n        total = body['count']\n        print(f\"Fetched {len(all_calls)} of {total}\")\n\n        if len(all_calls) >= total:\n            break\n        page += 1\n\n    return all_calls\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"nodejs--get-v1eventcalls","__idx":8},"children":["Node.js — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/eventCalls"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const BASE_URL = 'https://public.api.iclosed.io';\nconst HEADERS  = { 'Authorization': 'Bearer iclosed_YOUR_API_KEY' };\n\nasync function getAllCalls(eventType = 'ALL', limit = 100) {\n  const allCalls = [];\n  let page = 0;\n\n  while (true) {\n    const url = `${BASE_URL}/v1/eventCalls?eventType=${eventType}&limit=${limit}&page=${page}`;\n    const { data } = await fetch(url, { headers: HEADERS }).then(r => r.json());\n\n    allCalls.push(...data.eventCalls);\n    console.log(`Fetched ${allCalls.length} of ${data.count}`);\n\n    if (allCalls.length >= data.count) break;\n    page++;\n  }\n\n  return allCalls;\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"filtering-on-list-endpoints","__idx":9},"children":["Filtering on List Endpoints"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/eventCalls"]}," supports rich filtering alongside pagination:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventType"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["enum"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PAST"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UPCOMING"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ALL"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dateFrom"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Start of date range (inclusive)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dateTo"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["End of date range (inclusive)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ids"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma-separated call IDs"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userIds"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma-separated closer user IDs"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventIds"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma-separated event template IDs"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["outcomes"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma-separated: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WON"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NO_SALE"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["QUALIFIED"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UNQUALIFIED"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PENDING"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["APPROVED"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REJECTED"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PENDING_OUTCOME"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["types"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma-separated: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["scheduled_events"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rescheduled_events"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cancelled_events"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["callTypes"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma-separated: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["STRATEGY_EVENT"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DISCOVERY_EVENT"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["inviteeEmails"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma-separated invitee email addresses"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["search"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Free-text search across name, email, and phone"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setterIds"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma-separated setter user IDs"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contactId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Filter by a single contact ID"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["previewId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Filter by call preview ID"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example — get all WON calls from April 2026:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"GET /v1/eventCalls?eventType=PAST&dateFrom=2026-04-01&dateTo=2026-04-30&outcomes=WON&limit=100&page=0\n"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"see-also","__idx":10},"children":["See Also"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/api-reference"},"children":["Data Models"]}," — Response field schemas"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://api-docs-iclosed.redocly.app/openapi/v1/openapi"},"children":["API Reference"]}," — Full query parameter reference per endpoint"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/webhooks/introduction"},"children":["Webhooks"]}," — Use webhooks to avoid polling list endpoints altogether"]}]}]},"headings":[{"value":"Pagination","id":"pagination","depth":1},{"value":"How Pagination Works","id":"how-pagination-works","depth":2},{"value":"Endpoints That Support Pagination","id":"endpoints-that-support-pagination","depth":2},{"value":"Response Shapes","id":"response-shapes","depth":2},{"value":"GET /v1/eventCalls","id":"get-v1eventcalls","depth":3},{"value":"GET /v1/fields/objects","id":"get-v1fieldsobjects","depth":3},{"value":"Fetching All Records","id":"fetching-all-records","depth":2},{"value":"Python — GET /v1/eventCalls","id":"python--get-v1eventcalls","depth":3},{"value":"Node.js — GET /v1/eventCalls","id":"nodejs--get-v1eventcalls","depth":3},{"value":"Filtering on List Endpoints","id":"filtering-on-list-endpoints","depth":2},{"value":"See Also","id":"see-also","depth":2}],"frontmatter":{"seo":{"title":"Pagination"}},"lastModified":"2026-04-10T07:43:55.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/pagination","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}