Searching for users that belong to a combination of groups

I have a scenario where I have users that will belong to multiple groups.

I want to search for all users that belong to both Group 1 and Group 2. Is there a way to do that in a single API call?

From what I’m reading, it seems like you’d need to search for all users in Group 1, and then all users in Group 2, and then compare? (Or even worse, make an API call to get the groups for each individual user)

I’ve seen posts about this issue, such as this one. However, that post was quite a while ago, so perhaps there are new APIs I’m not aware of.

Making a request to list out the members for each group and then comparing the results sounds like the correct approach to me.