Okta Pagination

  • Click Here to see documentation from Okta
  • Okta has a very straight forward pagination interface to their API calls.  Here’s an example of getting information on 500 users.  The maximum number of return in Okta List User API is 200.  By the way, there’s no way to sort users as of 10/2019. See this post.
      • Note: %20% is a space and %22% is a quotation mark
      • Start the initial call to get a list of, say 25, active users
      • Check for the next link in the returned header and copy the last_user_id. Please note: rel=”next” means there are more users. Don’t confuse this with rel=”self”. If you don’t find a link like this in the header, there’s no more data.
        <https://your_okta_url/api/v1/users?after=last_user_id&limit=25>; rel="next"
      • Issue the next call using the last_user_id saved from the previous header.
      • Do this in a loop until you get all the users.