Skip to content

Roles

Manage roles and permissions within your organization. Roles are collections of permissions that can be assigned to users.

Get all available permissions in the system.

Terminal window
GET /api/permissions
{
"status": "success",
"data": {
"permissions": [
{
"id": "uuid",
"resource": "users",
"action": "read",
"description": "View users"
},
{
"id": "uuid",
"resource": "users",
"action": "write",
"description": "Create and edit users"
}
]
}
}

Get all roles in your organization.

Terminal window
GET /api/roles
Parameter Type Description
search string Filter by role name
{
"status": "success",
"data": {
"roles": [
{
"id": "uuid",
"name": "admin",
"description": "Full access to all features",
"is_system": true,
"is_default": false,
"permissions": ["users:read", "users:write", "users:delete"],
"user_count": 3,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
},
{
"id": "uuid",
"name": "Custom Role",
"description": "Custom role with specific permissions",
"is_system": false,
"is_default": false,
"permissions": ["chat:read", "chat:write"],
"user_count": 8,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
],
"total": 4,
"page": 1,
"limit": 50
}
}

permissions is a flat array of resource:action strings, and user_count is how many users hold the role. There is no permission_count field.

Get a single role with its permissions.

Terminal window
GET /api/roles/{id}
{
"status": "success",
"data": {
"id": "uuid",
"name": "Custom Role",
"description": "Custom role with specific permissions",
"is_system": false,
"is_default": false,
"permissions": [
{
"id": "uuid",
"resource": "contacts",
"action": "read",
"description": "View contacts"
},
{
"id": "uuid",
"resource": "contacts",
"action": "write",
"description": "Create and edit contacts"
}
],
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
}

Create a new custom role.

Terminal window
POST /api/roles
{
"name": "Support Agent",
"description": "Can view and respond to chats",
"permissions": ["contacts:read", "chat:read", "chat:write"]
}
Field Type Required Description
name string Yes Unique role name
description string No Role description
permissions array Yes Array of permission keys (e.g., resource:action)
is_default boolean No Set as default role for new users
{
"status": "success",
"data": {
"id": "uuid",
"name": "Support Agent",
"description": "Can view and respond to chats",
"is_system": false,
"is_default": false,
"permissions": [
{
"id": "uuid",
"resource": "contacts",
"action": "read",
"description": "View contacts"
}
],
"created_at": "2024-01-01T00:00:00Z"
}
}

Update an existing custom role.

Terminal window
PUT /api/roles/{id}
{
"name": "Senior Support Agent",
"description": "Can view, respond to chats, and access analytics",
"permissions": ["contacts:read", "chat:read", "chat:write", "analytics:read"]
}
Field Type Description
name string Role name
description string Role description
permissions array Array of permission keys
is_default boolean Set as default role for new users
{
"status": "success",
"data": {
"id": "uuid",
"name": "Senior Support Agent",
"description": "Can view, respond to chats, and access analytics",
"is_system": false,
"is_default": false,
"permissions": [...],
"updated_at": "2024-01-01T00:00:00Z"
}
}

Delete a custom role.

Terminal window
DELETE /api/roles/{id}
{
"status": "success",
"data": {
"message": "Role deleted successfully"
}
}

Permissions use the format resource:action. The only valid actions are: read, write, delete, sync, execute, import, export, pickup, and assign.

The full catalog below matches the permissions seeded on every organization.

  • users:read, users:write, users:delete
  • roles:read, roles:write, roles:delete
  • teams:read, teams:write, teams:delete
  • settings.general:read, settings.general:write
  • settings.chatbot:read, settings.chatbot:write
  • settings.sso:read, settings.sso:write
  • accounts:read, accounts:write, accounts:delete
  • templates:read, templates:write, templates:delete, templates:sync
  • flows.whatsapp:read, flows.whatsapp:write, flows.whatsapp:delete
  • flows.chatbot:read, flows.chatbot:write, flows.chatbot:delete
  • chatbot.keywords:read, chatbot.keywords:write, chatbot.keywords:delete
  • chatbot.ai:read, chatbot.ai:write, chatbot.ai:delete
  • chat:read, chat:write, chat.assign:write
  • contacts:read, contacts:write, contacts:delete, contacts:import, contacts:export
  • tags:read, tags:write, tags:delete
  • transfers:read, transfers:write, transfers:pickup
  • canned_responses:read, canned_responses:write, canned_responses:delete
  • campaigns:read, campaigns:write, campaigns:delete, campaigns:execute
  • analytics:read, analytics:write, analytics:delete, analytics.agents:read
  • audit_logs:read
  • webhooks:read, webhooks:write, webhooks:delete
  • api_keys:read, api_keys:write, api_keys:delete
  • custom_actions:read, custom_actions:write, custom_actions:delete
  • organizations:read, organizations:write, organizations:delete, organizations:assign
  • call_logs:read
  • ivr_flows:read, ivr_flows:write, ivr_flows:delete
  • call_transfers:read, call_transfers:write
  • outgoing_calls:read, outgoing_calls:write