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
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
x-tenant-id | Yes | Tenant UUID |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | UUID | User ID to update |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
roles | string[] | Yes | New 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
| Status | Description |
|---|---|
403 | Cannot modify roles of a user at same or higher level |
404 | User not found |