<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
How to Use Pagination when Making API Calls in Postman
Single Sign-On
Lifecycle Management
Okta Integration Network
Administration
API Access Management
Okta Classic Engine
Directories
Okta Identity Engine
SDKs & Libraries
Overview

Pagination returns a larger number of results than a single API request limit allows by "paging" through the results. This article provides an overview of pagination supported on many Okta API list endpoints.

Applies To
  • API calls
  • Postman
  • Pagination
Cause

If a value for the limit parameter is not specified when requesting a list of results (for example, in the List Users API), the maximum (200) is used as a default. Pagination is required to return more results than this limit.

Solution

For this example, List Users is used from the Users API:

  1. In Postman, generate a List Users API call: {{url}}/api/v1/users?limit=200.
  2. Click Send.
  3. In the Response, navigate to Headers.
  4. On the Headers tab, see two link headers. The header that is relevant is the one that contains rel="next".
    • In that header, see the following:
      • <https://orgname.okta.com/api/v1/users?after=*****************&limit=200>; rel="next."

  1. Copy the portion highlighted in bold above from the link header mentioned in Step 4.
  2. Create a new List Users API call (right-click in the left side menu on List Users > Open in new tab).
  3. Paste the portion copied from the link header after the "?" in the API request.
  4. This will return the results on the next page in the response body for this API call.
  5. Once there are no more Link Headers with rel="next" in the response, there are no more results.

Use this process in scripting to return results automatically. For more information, see the related references below.
 

NOTE: Certain endpoint parameters may not support pagination. For example, if Admins are using the q parameter for Find Users, the default limit is 10, and this parameter does not support pagination. Please refer to the respective Okta Developer API references for the endpoint Admins are working with.

Related References

Loading
How to Use Pagination when Making API Calls in Postman