{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Paginação","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":"paginação","__idx":0},"children":["Paginação"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Coleções retornam com o envelope ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.entityList"]}," + ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.pageInformation"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"parâmetros","__idx":1},"children":["Parâmetros"]},{"$$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":"Nome"},"children":["Nome"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Default"},"children":["Default"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Máximo"},"children":["Máximo"]}]}]},{"$$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":"resposta","__idx":2},"children":["Resposta"]},{"$$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":"estratégia-recomendada","__idx":3},"children":["Estratégia recomendada"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pageSize: 100"]}," em jobs de sincronização — menos chamadas, mesmo custo."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Nunca"]}," confie em ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["totalItems"]}," para decidir a última página: itera"," ","enquanto ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page < totalPages"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Aplique backoff se ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429"]}," aparecer; o rate limit é por IP, não por página."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"pseudocódigo","__idx":4},"children":["Pseudocódigo"]},{"$$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":"Paginação","id":"paginação","depth":1},{"value":"Parâmetros","id":"parâmetros","depth":2},{"value":"Resposta","id":"resposta","depth":2},{"value":"Estratégia recomendada","id":"estratégia-recomendada","depth":2},{"value":"Pseudocódigo","id":"pseudocódigo","depth":2}],"frontmatter":{"title":"Paginação","description":"Como usar page, pageSize e o envelope pageInformation.","seo":{"title":"Paginação"}},"lastModified":"2026-04-24T13:01:34.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/pagination","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}