{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Pagination","siteUrl":"https://docs.api.dentally.com"},"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 in the Dentally NexGen API are ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["cursor‑paginated"]},". A cursor is an"," ","opaque token that points to the next page of results; you carry it forward"," ","from one response to the next request until the server tells you there are no"," ","more pages."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Cursor pagination scales predictably for large datasets and is stable under"," ","inserts and deletes happening between page fetches — unlike offset pagination,"," ","which can skip or repeat rows when the underlying data changes."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"query-parameters","__idx":1},"children":["Query parameters"]},{"$$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":"In"},"children":["In"]},{"$$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":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$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":["query"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer (1–50)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["25"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Maximum number of records to return on this page."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cursor"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["query"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Opaque cursor returned by the previous page's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["meta.cursor"]},". Omit for the first page."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"response-envelope","__idx":2},"children":["Response envelope"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Paginated responses always include a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["meta"]}," object alongside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": [ /* … */ ],\n  \"meta\": {\n    \"cursor\": \"eyJjcmVhdGVkX2F0IjoiMjAyNS0wOC0xMlQxMTowMDowMFoifQ\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["meta.cursor"]}," is:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["string"]}," when there is at least one more page. Pass it back as the"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cursor"]}," query parameter on the next request."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}," when you have reached the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["last page"]},". Stop iterating."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treat the cursor as ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["opaque"]}," — its contents are an implementation detail and"," ","may change without notice."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"walking-a-list","__idx":3},"children":["Walking a list"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# First page\ncurl 'https://…/v2/sites?limit=50' \\\n  -H 'Authorization: Bearer <jwt>' \\\n  -H 'Dentally-API-Version: 2026-01-01' \\\n  -H 'X-Practice-Id: <practice-uuid>'\n\n# Subsequent pages — pass meta.cursor from the previous response\ncurl 'https://…/v2/sites?limit=50&cursor=eyJjcmVhdGVkX2F0IjoiMjAyNS0wOC0xMlQxMTowMDowMFoifQ' \\\n  -H 'Authorization: Bearer <jwt>' \\\n  -H 'Dentally-API-Version: 2026-01-01' \\\n  -H 'X-Practice-Id: <practice-uuid>'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"tips","__idx":4},"children":["Tips"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Choose the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["largest ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}]}," your client can comfortably process. Fewer"," ","round trips means faster end‑to‑end iteration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Iterate to completion in a tight loop; cursors are not designed to be held"," ","for long periods."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Don't try to construct, mutate or compare cursors. They are not URLs and"," ","carry no guarantees about their internal shape."]}]}]},"headings":[{"value":"Pagination","id":"pagination","depth":1},{"value":"Query parameters","id":"query-parameters","depth":2},{"value":"Response envelope","id":"response-envelope","depth":2},{"value":"Walking a list","id":"walking-a-list","depth":2},{"value":"Tips","id":"tips","depth":2}],"frontmatter":{"seo":{"title":"Pagination"}},"lastModified":"2026-07-07T02:45:45.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/pages/pagination","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}