How to access group IDs in management API

How do I access group IDs from the management API? (java)
I can go into the dashboard and look at the raw json for a user, and see that group IDs are present under “groups”.

But the User class doesn’t have any apparent way to access those group IDs. How can I get that list of IDs?

Hi @andy.lee,

Welcome to the Auth0 Community!

You should be able to get a user’s groups using the Management API’s Get a user endpoint. The returned response will include the groups property with the same JSON format you saw when reading the user’s raw JSON.

If you need to get a list of users group IDs, you will have to use the Management API List or Search Users endpoint and filter by fields=user_id,app_metadata.authorization.groups.

Thanks,
Rueben

1 Like

FWIW using the java client, the info comes back in the Values map, under the groups key as a List.

1 Like

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