Herald
OpenapiPermission

Assign roles to user

Assigns one or more roles to a user

POST
/api/permission/users/{userId}/roles

Assigns one or more roles to a user

Path Parameters

userId*string

User ID

Formatuuid

Request Body

application/json
  1. body
roleIds*array<>

Response Body

Roles assigned successfully

application/json
  1. response
roles*array<>
Example Request
curl -X POST 'https://example.com/api/permission/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/roles' \
  -H 'Content-Type: application/json' \
  -d '{
  "roleIds": [
    "10960216-a894-4481-b8f2-270c1c8fab34"
  ]
}'
Example Response
{
  "roles": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "string",
      "realmId": "string"
    }
  ]
}