Obtain the groups for all the users


I’m obtaining the users on the system with the GET /user API call. I’d need to get also the groups that each user belongs to, but I only see a GET /identity/groups call, that requires a user id. Is there a way to get this data without calling the mentioned method for each user?


Hey @felipRR,

What is your use case for this? It seems odd that you need this information for every user.

Generally, you will have to correlate the 2 data sets somehow. There are multiple options for this, e.g. a custom SQL query.
If you only want to use the provided REST endpoints, it might result in less requests if you query for all groups, and then fetch all members of each group with the User Query and memberOfGroup Parameter.


This requirement is not mandatory, but we’d like to manage the following scenario:

  • An “Start agreement” task with a users list to select the next task assignee
  • A “Check agreement” task that can only be assigned to users of the group “Checkers”
  • A “Legal assessment” task, only assignable to “Consultants” users
  • We’d like that when a user is selected in the start task, the next one (either “Check agreement” or “Legal assessment”) would be started automatically depending on the group of the selected user.

As I said, it’s not mandatory because I can run one task or another using checkboxes or a combo, but I was thinking to make the user’s life easier…

Thanks for your suggestions!

I’m interested in the custom SQL query. Could you show an example of how to do a simple query (f.i. a list of all the groups) from a Camunda Java Delegate or Listener?

Thanks in advance,