Skip to main content
GET
https://api.trillet.ai
/
v1
/
api
/
roles-and-permissions
/
roles
List Roles
curl --request GET \
  --url https://api.trillet.ai/v1/api/roles-and-permissions/roles \
  --header 'x-api-key: <api-key>' \
  --header 'x-workspace-id: <x-workspace-id>'
[
  {
    "_id": "665a1b2c3d4e5f6a7b8c9d0e",
    "name": "Admin",
    "description": "Full access to all workspace features",
    "permissions": [
      { "key": "agent_view", "category": "agents" },
      { "key": "agent_create", "category": "agents" }
    ],
    "userIds": ["user_001", "user_002"]
  },
  {
    "_id": "665a1b2c3d4e5f6a7b8c9d0f",
    "name": "Viewer",
    "description": "Read-only access",
    "permissions": [
      { "key": "agent_view", "category": "agents" },
      { "key": "call_history_view", "category": "calls" }
    ],
    "userIds": ["user_003"]
  }
]

Headers

x-api-key
string
required
API key used for authenticating requests to the API.
x-workspace-id
string
required
Workspace identifier for the API.

Response Fields

roles
array
Array of role objects.
_id
string
Unique identifier for the role.
name
string
Name of the role.
description
string
Description of the role.
permissions
array
Array of permission objects.
userIds
array
Array of user IDs assigned to this role.
[
  {
    "_id": "665a1b2c3d4e5f6a7b8c9d0e",
    "name": "Admin",
    "description": "Full access to all workspace features",
    "permissions": [
      { "key": "agent_view", "category": "agents" },
      { "key": "agent_create", "category": "agents" }
    ],
    "userIds": ["user_001", "user_002"]
  },
  {
    "_id": "665a1b2c3d4e5f6a7b8c9d0f",
    "name": "Viewer",
    "description": "Read-only access",
    "permissions": [
      { "key": "agent_view", "category": "agents" },
      { "key": "call_history_view", "category": "calls" }
    ],
    "userIds": ["user_003"]
  }
]