Hey community 🙂 Is it possible to
Hey community 🙂 Is it possible to remove a user from ALL groups? I looked at the docs for v1/tspublic/v1/user/<user_guid>/groups and api/rest/2.0/users/<user_name>/update but cannot find anything that would remove ALL groups without specifying a list of groupIDs.
We are in need of calling a TS API when a user logs in that will a) remove them from ALL groups and b) add them to a single group just for that session. Is this possible with v1 or v2 APIs?
I know there is an API to remove all Users from a Group... we want the inverse... remove all Groups from a User without having to specify a list of groups.
2 Replies
If you update the user with just the groups you want them to belong to, it will remove the others. If you want to remove all, I think you can just send an empty list, e.g. []. I'd test in the playground to verify.
operation: REPLACE and pass the group_identifiers as [] as @bill_da_golfer suggested should help in api/rest/2.0/users/<user_name>/update API