
AndrewC.67337 (Customer) asked a question.
As far as I can see, the only to count membership by app using the API is to list the AppIds for every app and then forEach through the list; calling the user list for each id and append to a count as we go. This understandably takes an age to complete. Is there a more efficient way to do this using the API?

Hello @AndrewC.67337 (Customer) Thank you for posting on our Community page!
I would actually recommend to use the Reports section from the admin dashboard to get this information. In the Reports section you have the option to get a report for each application and the users that are assigned to it.
Please see our doc below:
https://support.okta.com/help/s/article/How-to-generate-application-assignment-report-for-a-specific-app?language=en_US
This can be done through API as well, please see our doc below for this:
https://support.okta.com/help/s/article/how-to-create-a-report-of-users-assigned-to-specific-application?language=en_US
Thank you for reaching out to our Community and have a great day!
--
Help others in the community by liking or hitting Select as Best if this response helped you.
Collect them all. Learn a new skill and earn a new Okta Learning badge.
@AndrewC.67337 (Customer) -- As you have noticed from the API documentation the "Expand" doesn't have a count option: https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Application/#tag/Application/operation/listApplications
Group's also previously didn't have a count option and it was relatively recently added to the Expand options.
There is likely already an Okta Idea. However, if not this would definitely be a good candidate. Any usability enhancement IMO is a positive.
https://support.okta.com/help/s/article/Okta-Ideas-Overview-FAQ?language=en_US
Thank you. Yes it doesn't look like expand would be useful in this case, but good to know it exists.
Interestingly, you mentioned Groups now has a count within its expand option. However looking at the api docs, I can't see a count within the metadata segment. Where would I find this?