{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-PublicAPI/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Bulk GET — Total Count Behavior","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":"bulk-get--total-count-behavior","__idx":0},"children":["Bulk GET — Total Count Behavior"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Reference:"]}," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://papidocs.hs1api.com/publicapi/api-consumer-guide#bulk-operations"},"children":["API Consumer Guide — Bulk Operations"]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Bulk GET endpoints return a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pagination"]}," object in every response. This object includes a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," field representing the total number of records matching your query. The value of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," — and whether it appears at all — depends on which query parameters are present in your request."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"when-you-will-see-paginationtotal","__idx":2},"children":["When You Will See ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pagination.total"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"total-is-0--plain-bulk-get-default-behavior","__idx":3},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}," — Plain bulk GET (default behavior)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you make a plain bulk GET request without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastId"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," will be ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]},". This means the count was not computed and does ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["not"]}," indicate that zero records exist."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"GET /api/v1/appointments?pageSize=500&filter=lastModified>2025-01-01T00:00:00Z\n"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": [...],\n  \"pagination\": {\n    \"limit\": 500,\n    \"offset\": 0,\n    \"total\": 0\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}," array and whether it is empty to determine if more pages are available — do not rely on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," for this purpose."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"total-is-absent--cursor-pagination-with-lastid","__idx":4},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," is absent — Cursor pagination with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastId"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastId"]}," is present in the request, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pagination.total"]}," will ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["not be present"]}," in the response at all."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"GET /api/v1/appointments?lastId=8000052360370&pageSize=500&filter=lastModified>2025-01-01T00:00:00Z\n"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": [...],\n  \"pagination\": {\n    \"limit\": 500,\n    \"offset\": 0\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is the recommended pagination pattern. When using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastId"]},", you do not need ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," — you continue fetching pages until ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}," is empty."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"total-is-absent--offset-pagination-with-page","__idx":5},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," is absent — Offset pagination with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the deprecated ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]}," query parameter is used, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pagination.total"]}," will not be present."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note:"]}," The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]}," parameter is deprecated. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastId"]}," pagination instead."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"behavior-summary","__idx":6},"children":["Behavior Summary"]},{"$$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":{"align":"left","data-label":"Request type"},"children":["Request type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"center","data-label":"lastId present"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastId"]}," present"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"center","data-label":"page present"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]}," present"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"pagination.total"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pagination.total"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Plain bulk GET"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"center"},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"center"},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Cursor pagination"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"center"},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"center"},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Field absent"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Offset pagination (deprecated)"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"center"},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"center"},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Field absent"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"pagination-response-object","__idx":7},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pagination"]}," Response Object"]},{"$$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":{"align":"left","data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The page size used for this request"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["offset"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The record offset applied to this request"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Present only when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]}," are absent. Returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}," — the total record count is not computed."]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"recommendations","__idx":8},"children":["Recommendations"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Do not rely on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pagination.total"]}," to determine whether more pages exist."]}," The reliable signal for end-of-results is an empty ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}," array."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastId"]}," cursor pagination for all bulk fetches."]}," This is the most efficient pattern. See the endpoint-specific guides for step-by-step ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastId"]}," pagination instructions."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/publicapi/endpoints/appointments-v1"},"children":["Appointments V1 — Developer Guide"]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"important-notes","__idx":9},"children":["Important Notes"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["⚠️ Breaking change for consumers reading ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pagination.total"]},":"]}," If your integration reads ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," to calculate progress or determine whether to continue paginating, you must update your logic. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," will be ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}," for all plain bulk GETs. Use the presence or absence of records in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}," instead."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["⚠️ Rate Limited:"]}," Bulk GET endpoints are rate limited. See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://papidocs.hs1api.com/publicapi/api-consumer-guide#rate-limiting"},"children":["rate limiting guide"]}," for details."]}]}]},"headings":[{"value":"Bulk GET — Total Count Behavior","id":"bulk-get--total-count-behavior","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"When You Will See pagination.total","id":"when-you-will-see-paginationtotal","depth":2},{"value":"total is 0 — Plain bulk GET (default behavior)","id":"total-is-0--plain-bulk-get-default-behavior","depth":3},{"value":"total is absent — Cursor pagination with lastId","id":"total-is-absent--cursor-pagination-with-lastid","depth":3},{"value":"total is absent — Offset pagination with page","id":"total-is-absent--offset-pagination-with-page","depth":3},{"value":"Behavior Summary","id":"behavior-summary","depth":2},{"value":"pagination Response Object","id":"pagination-response-object","depth":2},{"value":"Recommendations","id":"recommendations","depth":2},{"value":"Important Notes","id":"important-notes","depth":2}],"frontmatter":{"title":"BulkGetTotalCount","toc":true,"description":"How pagination.total behaves in bulk GET endpoints — when you will see a real count, zero, or no total field at all","seo":{"title":"Bulk GET — Total Count Behavior"}},"lastModified":"2026-03-10T20:23:38.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/publicapi/bulk-get-total-count","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}