Reten Docs
Users

Update User Roles

Update the role assignments for a user.

PUT /api/user/:id/roles

Update the roles assigned to a specific user. The calling user must have a higher role than the target user.

Auth: Required — UPDATE_USER permission

Headers

HeaderRequiredValue
AuthorizationYesBearer <access_token>
x-tenant-idYesTenant UUID

Path Parameters

ParameterTypeDescription
idUUIDUser ID to update

Request Body

FieldTypeRequiredDescription
rolesstring[]YesNew array of role names

Example

curl -X PUT https://api.reten.ai/api/user/550e8400-e29b-41d4-a716-446655440000/roles \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "roles": ["ADMIN", "FDE"]
  }'
import axios from 'axios';

const response = await axios.put(
  'https://api.reten.ai/api/user/550e8400-e29b-41d4-a716-446655440000/roles',
  {
    roles: ['ADMIN', 'FDE'],
  },
  {
    headers: {
      Authorization: 'Bearer <token>',
      'x-tenant-id': '<tenant-id>',
    },
  }
);

Response 200 OK

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "roles": ["ADMIN", "FDE"]
}

Error Responses

StatusDescription
403Cannot modify roles of a user at same or higher level
404User not found