{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/en/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Pagination","description":"Documentação oficial, guias e referência da API Auvo v2.","siteUrl":"https://developers.auvo.com.br","lang":"pt-BR","keywords":"auvo, api, documentação, developers, field service, workforce","meta":[{"name":"og:site_name","content":"Auvo Developers"},{"name":"og:locale","content":"pt_BR"},{"name":"og:locale:alternate","content":"es_ES"},{"name":"og:locale:alternate","content":"en_US"},{"name":"twitter:card","content":"summary_large_image"},{"name":"twitter:site","content":"@auvoapp"}],"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":["Collections return a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.entityList"]}," + ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.pageInformation"]}," envelope."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"parameters","__idx":1},"children":["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":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Default"},"children":["Default"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Max"},"children":["Max"]}]}]},{"$$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":["1"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pageSize"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["50"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"response","__idx":2},"children":["Response"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"result\": {\n    \"entityList\": [/* ... */],\n    \"pageInformation\": {\n      \"page\": 1,\n      \"pageSize\": 50,\n      \"totalPages\": 12,\n      \"totalItems\": 574\n    }\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"recommended-strategy","__idx":3},"children":["Recommended strategy"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pageSize: 100"]}," for sync jobs — fewer calls, same cost."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Never"]}," rely on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["totalItems"]}," to detect the last page: iterate while"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page < totalPages"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Back off if you see ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429"]},"; the rate limit is per IP, not per page."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"pseudocode","__idx":4},"children":["Pseudocode"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"let page = 1;\nwhile (true) {\n  const { result } = await fetchPage(page);\n  await process(result.entityList);\n  if (page >= result.pageInformation.totalPages) break;\n  page += 1;\n}\n","lang":"ts"},"children":[]}]},"headings":[{"value":"Pagination","id":"pagination","depth":1},{"value":"Parameters","id":"parameters","depth":2},{"value":"Response","id":"response","depth":2},{"value":"Recommended strategy","id":"recommended-strategy","depth":2},{"value":"Pseudocode","id":"pseudocode","depth":2}],"frontmatter":{"title":"Pagination","description":"How to use page, pageSize and the pageInformation envelope.","seo":{"title":"Pagination"}},"lastModified":"2026-04-24T13:01:34.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/en/guides/pagination","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}