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/{realmId}/{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

realmId*string

Realm ID

userId*string

User ID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

roleIds*array<>

Response Body

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/users/string/497f6eca-6276-4993-bfeb-53cbbbba6f08/roles" \  -H "Content-Type: application/json" \  -d '{    "roleIds": [      "10960216-a894-4481-b8f2-270c1c8fab34"    ]  }'
Empty
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}