Replace a user's group memberships
PUT/tap/api/v3/groups/user/:userId/memberships
Sets the complete set of groups a user belongs to. The user is added to each listed group they are not in, and removed from each group they are in that is not listed, so an empty groupIds removes every membership. Every group to be added is checked before any membership changes, so a 404 changes nothing. Each new membership stores a copy of the user's fullName, email, and userRole. A membership that cannot be saved or removed is skipped without an error. Unlike POST /tap/api/v3/groups/{groupId}/members, a server ID is accepted, so a server can be made a group member. Requires the admin role.
Request
Responses
- 200
- 400
- 403
- 404
- 500
The memberships were updated.
The user ID is not a decimal number, the request body has no groupIds, or the request body is not a JSON object whose groupIds is an array of IDs.
The caller does not have the admin role, or the user is a super_admin and the caller is not.
No user or server exists with the given ID ("User not found."), or a group to be added does not exist ("User Group not found.").
The memberships could not be updated.