Herald
OpenapiUsers

Update user roles

Updates the roles assigned to a user. Replaces all existing roles with the new list. **Security constraints**: - Realm-admin can only assign "user" role, not "realm-admin"

PUT
/api/users/{userId}/roles

Updates the roles assigned to a user. Replaces all existing roles with the new list.

Security constraints:

  • Realm-admin can only assign "user" role, not "realm-admin"

Path Parameters

userId*string

User ID

Formatuuid

Request Body

application/json
  1. body
roleIds*array<>

Response Body

Roles updated

Example Request
curl -X PUT 'https://example.com/api/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/roles' \
  -H 'Content-Type: application/json' \
  -d '{
  "roleIds": [
    "10960216-a894-4481-b8f2-270c1c8fab34"
  ]
}'
Example Response
Empty