Role IdentityCount

In the /cc/api/role/list there is an IdentityCount that is the number of users with that role. This is the API used on the Role page.

What is the way to get this value using the /beta/roles API or equivalent?

@ethompson ,

Try using the count=true query param on the list roles endpoint. This will add the X-Total-Count header in the response with the number of records that match your query parameter criteria.

Example: GET https://{tenant}.api.identitynow.com/beta/roles?filters=name eq "Admin Role"&count=true

This will give me the count of Roles returned. In this case 1 if the filter is name eq “Test AD Provision”.

But what I want is the users, so 148:

image

My solution is to user /v3/search with the count and search for users with that access:

Ah, yea, the search API is the appropriate method here. Good call!

This is another option but may be a better approach as this is what the UI is using:

https://developer.sailpoint.com/apis/beta/#operation/getRoleAssignedIdentities

https://org.api.identitynow.com/beta/roles/role-id/assigned-identities?limit=50&offset=0&count=true&sorters=name

1 Like