Get the Count of Users without using pagination


I’m new to Okta. As I was looking at okta docs and i couldn’t find a most elegant way to get users count without looping through and making multiple calls to okta.

I was using this approach of getting response from “/api/v1/users”, which would only give us 200 users along with a “next” value. And i was using that “next” Value and making another call to okta and so on untill there is no “next” value.

Please let me know if there is a nicer approach to resolve this problem.


1 Like

I am having to get a count of roughly a million users in the Okta database. This doesn’t look like the most optimal way to get user count. Please help?

Every user is a member of the “Everyone” group. You can find the group and see how many members it has:

GET /api/v1/groups?q=Everyone&expand=stats

then look at _embedded.stats.usersCount. see Groups | Okta Developer

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.