Update Role
Update an existing role's name, description, permissions, or assigned users.
Requires the role:edit permission in the workspace.
Headers
x-workspace-idstringrequiredWorkspace identifier for the API.
Path Parameters
roleIdstringrequiredThe unique identifier of the role to update.
Request Body
namestringUpdated name for the role.
descriptionstringUpdated description for the role. Must not be empty.
permissionsarray of stringsThe complete new set of permission keys, in category:action form (e.g., "agent:view"). This replaces the role's permissions; it is not merged with them. At least one key is required when the field is sent. Use List Permissions for the available keys.
userIdsarray of stringsrequiredUser IDs to assign this role to, in addition to the users who already hold it. Send [] to assign no one new.
For the built-in system roles (owner, admin, editor, viewer), only userIds is applied. The name, description and permissions of a system role can't be changed.
Response
_idstringUnique identifier for the role.
namestringUpdated name of the role.
descriptionstringUpdated description of the role.
permissionsobjectPermissions grouped by category, as in Create Role.
{
"name": "Senior Manager",
"description": "Manages agents and reviews call history",
"permissions": [
"agent:view",
"agent:create",
"agent:edit",
"agent:delete",
"call_history:view"
],
"userIds": []
}{
"_id": "a4a4a4a4a4a4a4a4a4a4a4a4",
"workspaceId": "a1a1a1a1a1a1a1a1a1a1a1a1",
"name": "Senior Manager",
"description": "Manages agents and reviews call history",
"permissions": {
"agent": ["agent:view", "agent:create", "agent:edit", "agent:delete"],
"call_history": ["call_history:view"]
},
"isSystem": false,
"createdAt": "2024-06-01T09:00:00.000Z",
"updatedAt": "2024-06-02T10:30:00.000Z",
"__v": 0
}Last updated on