{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Pagination","description":"API documentation for the Bright Customer API, providing comprehensive guides and reference materials for developers integrating with Bright products.","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 use continuation token-based pagination to retrieve results across multiple requests."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-it-works","__idx":1},"children":["How It Works"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For the first request, do not provide a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continuationToken"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The response will include an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["items"]}," array and, if there are more results, a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continuationToken"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Pass the returned ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continuationToken"]}," in the next request to retrieve the subsequent page of results."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Continue requesting with the latest ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continuationToken"]}," until the response returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}," for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continuationToken"]},", indicating there are no more results."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"parameters","__idx":2},"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":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$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":["continuationToken"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The token from the previous response. Omit for the first page."]}]},{"$$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":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["int"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The maximum number of items to return per page. Must be between 1 and 100. Defaults to 100."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sorting","__idx":3},"children":["Sorting"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Some list endpoints support sorting via the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sortBy"]}," parameter. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sortBy"]}," parameter is optional and accepts a list of sort options. Refer to each endpoint's documentation for the available sort fields."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"filtering","__idx":4},"children":["Filtering"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["List endpoints support filtering via the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filters"]}," parameter. The available filter fields are endpoint-specific and some endpoints require that certain filters are set. Refer to each endpoint's documentation for the available filter criteria."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"response-format","__idx":5},"children":["Response Format"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All list endpoints return a response in the following format:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"items\": [\n    ...\n  ],\n  \"continuationToken\": \"eyJza2lwIjo...\"\n}\n","lang":"json"},"children":[]},{"$$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":"Field"},"children":["Field"]},{"$$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":["items"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["array"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The list of items for the current page."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continuationToken"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A token to retrieve the next page, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}," if this is the last page."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example","__idx":6},"children":["Example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example uses the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["List Employees"]}," endpoint to illustrate pagination."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"first-request","__idx":7},"children":["First Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the first page, send a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," request without a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continuationToken"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.bright.hr/employees/v1/query \\\n  -H \"Authorization: Bearer YOUR_BEARER_TOKEN\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"first-response","__idx":8},"children":["First Response"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"items\": [ ... ],\n  \"continuationToken\": \"eyJza2lwIjo...\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The presence of a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continuationToken"]}," indicates there are more results."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"second-request","__idx":9},"children":["Second Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To retrieve the next page, send the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continuationToken"]}," in the request body:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://api.bright.hr/employees/v1/query \\\n  -H \"Authorization: Bearer YOUR_BEARER_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"continuationToken\": \"eyJza2lwIjo...\"}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"last-response","__idx":10},"children":["Last Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When there are no more results, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continuationToken"]}," will be ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"items\": [ ... ],\n  \"continuationToken\": null\n}\n","lang":"json"},"children":[]}]},"headings":[{"value":"Pagination","id":"pagination","depth":1},{"value":"How It Works","id":"how-it-works","depth":2},{"value":"Parameters","id":"parameters","depth":2},{"value":"Sorting","id":"sorting","depth":2},{"value":"Filtering","id":"filtering","depth":2},{"value":"Response Format","id":"response-format","depth":2},{"value":"Example","id":"example","depth":2},{"value":"First Request","id":"first-request","depth":3},{"value":"First Response","id":"first-response","depth":3},{"value":"Second Request","id":"second-request","depth":3},{"value":"Last Response","id":"last-response","depth":3}],"frontmatter":{"slug":["/pagination"],"seo":{"title":"Pagination"}},"lastModified":"2026-05-13T11:48:33.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/pagination","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}