Update user group relation
PUT/groups-srv/usergroups/:groupId/users/:sub
This API call updates the user group relation for instance to add or remove roles the user holds in this user group.
Updatable Fields:
roles: Can be updated to add or remove roles for the user in this group- The
rolesarray replaces the existing roles (it is not merged)
Immutable Fields:
sub: Cannot be changed (must match path parameter)groupId: Cannot be changed (must match path parameter)
Validation Rules:
- The user group map must exist (user must already be a member of the group)
sub: Must match the path parameter exactlygroupId: Must match the path parameter exactlyroles: Optional array, all roles must:- Exist in the system
- Be allowed by the group's groupType configuration (if groupType has
roleMode: allowed_roles) - Be valid role names (case-sensitive)
Business Rules:
- The
rolesarray completely replaces existing roles (to add roles, include all desired roles in the array) - Role validation follows the same rules as user group map creation
- If the group's groupType has
roleMode: no_roles, therolesarray must be empty
Request
Responses
- 200
- 401
- 404
- 417
OK - User group map updated successfully
Unauthorized - Authentication failed or missing required scope
Not Found - User group map does not exist (user is not a member of the specified group)
Expectation Failed - Validation failed (e.g., invalid roles, roles not allowed by groupType)