Trillet AI logo

Get Role

Retrieve a specific role by its ID.

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

Requires the role:view permission in the workspace.

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Path Parameters

roleIdstringrequired

The unique identifier of the role. An ID that matches no role in the workspace returns 404.

Response Fields

_idstring

Unique identifier for the role.

namestring

Name of the role.

descriptionstring

Description of the role.

permissionsobject

Permissions grouped by category. Each key is a category and its value is the list of permission keys.

isSystemboolean

true for the built-in roles (owner, admin, editor, viewer).

workspaceIdstring

Workspace the role belongs to. Absent on system roles.

createdAtstring

Timestamp when the role was created.

updatedAtstring

Timestamp when the role was last updated.

This endpoint doesn't return the role's users. Use List Roles, which includes userIds for each role.

{
  "_id": "a4a4a4a4a4a4a4a4a4a4a4a4",
  "workspaceId": "a1a1a1a1a1a1a1a1a1a1a1a1",
  "name": "Agent Manager",
  "description": "Can manage agents and view call history",
  "permissions": {
    "agent": ["agent:view", "agent:create", "agent:edit"],
    "call_history": ["call_history:view"]
  },
  "isSystem": false,
  "createdAt": "2024-06-01T09:00:00.000Z",
  "updatedAt": "2024-06-01T09:00:00.000Z",
  "__v": 0
}

Last updated on