remove user from all groups
-
Is there an api I can call that removes a user from all groups? I can see one that explicitly removes them from a particular group, but I'd like to remove them from all groups.
-
Hiya, there is no API I know of that will remove a user from all groups, but you can certainly chain APIs. The way I'd do it would be to retrieve the user using the User API, iterate all
user.memberships
and get thegroupId
from each one. Then I'd use the Group API to remove the user from each group, usingDELETE
against/api/group/member?groupId={groupId}&userId={userId}
Hope that helps, thanks for using FusionAuth!