Trillet AI logo

Update Role

Update an existing role's name, description, or permissions.

PUThttps://api.trillet.ai/v1/api/roles-and-permissions/roles/{roleId}

Headers

x-api-keystringrequired

API key used for authenticating requests to the API.

x-workspace-idstringrequired

Workspace identifier for the API.

Path Parameters

roleIdstringrequired

The unique identifier of the role to update.

Request Body

namestring

Updated name for the role.

descriptionstring

Updated description for the role.

permissionsarray of strings

Updated array of permission ID strings. Each item must be a string (e.g., "agent_view"). Use the List Permissions endpoint to retrieve available permission IDs.

userIdsarray

Updated array of user IDs to assign.

Response Fields

_idstring

Unique identifier for the role.

namestring

Updated name of the role.

descriptionstring

Updated description of the role.

permissionsarray

Updated permissions array.

{
  "name": "Senior Manager",
  "description": "Full access to everything including billing and settings",
  "permissions": [
    "agent_view",
    "agent_create",
    "agent_edit",
    "agent_delete",
    "call_history_view"
  ]
}
{
  "_id": "665a1b2c3d4e5f6a7b8c9d0e",
  "name": "Senior Manager",
  "description": "Full access to everything including billing and settings",
  "permissions": [
    { "key": "agent_view", "category": "agents" },
    { "key": "agent_create", "category": "agents" },
    { "key": "agent_edit", "category": "agents" },
    { "key": "agent_delete", "category": "agents" },
    { "key": "call_history_view", "category": "calls" }
  ]
}