<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 Okta API Calls in Postman

Single Sign-On
Lifecycle Management
Okta Integration Network
Administration
Okta Classic Engine
Directories
Okta Identity Engine
SDKs & Libraries

Overview

When requesting a list of results from an Okta Application Programming Interface (API) endpoint without specifying a limit parameter, Okta defaults to a maximum of 200 results. Okta requires pagination to return a larger number of results than a single API request limit allows. Retrieve additional results by locating the next link in the response headers and generating a new API call with the provided URL.

Applies To

  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Application Programming Interface (API) Calls
  • Postman
  • Pagination

Solution

How is pagination used when making Okta API calls in Postman?

The following example uses the List Users endpoint from the Users API. Generate a List Users API call in Postman, locate the next link in the response headers, and use it to create a subsequent request to retrieve the next page of results.

  1. In Postman, generate a List Users API call using the following format:
    {{url}}/api/v1/users?limit=200
  2. Choose Send.
  3. In the Response, navigate to Headers.
  4. On the Headers tab, locate the two link headers and identify the header that contains rel="next".
  5. In that header, locate the URL format similar to the following example:
    <https://<orgname.okta.com>/api/v1/users?after=*****************&limit=200>; rel="next"

Postman

  1. Copy the URL portion from the link header identified in the previous step.
  2. Create a new List Users API call by right-clicking List Users in the left side menu and choosing Open in new tab.
  3. Paste the copied portion from the link header after the ? in the API request.
  4. Choose Send to return the results on the next page in the response body for this API call.

 

Once the response omits Link Headers with rel="next", Okta has returned all available results. Implement this process in scripting to return results automatically. For more information, see the related references below.

 

NOTE: Certain endpoint parameters omit support for pagination. For example, using the q parameter for Find Users sets the default limit to 10 and prevents pagination. Refer to the respective Okta Developer API references for the specific endpoint requirements.

 

Related References

Loading
Okta Support - How to Use Pagination When Making Okta API Calls in Postman