Skip to main content

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 roles array 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 exactly
  • groupId: Must match the path parameter exactly
  • roles: 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 roles array 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, the roles array must be empty

Request

Responses

OK - User group map updated successfully