Team Roles

Create a custom role.

Changed on

Creates a new custom role for the team with the specified permissions. Role names cannot match reserved role names (Owner, Administrator, Member).

post/api/v1/teams/roles

Request

Request body

namestring

Role name. Cannot match a reserved system role name. Max 255 characters.

descriptionstring

Description of the role. Max 255 characters.

type'local' | 'global'

Role scope. Use local to restrict access to specific agents; use global to grant access to all team agents.

is_chat_onlyboolean

When true, members with this role can only use chat. The permissions field is ignored and set automatically.

permissionsstring[]

Permission names to grant to this role. Ignored when is_chat_only is true. Omit or pass an empty array for no permissions.

agentsinteger[]

Agent IDs this role grants access to. Required when type is local.

allow_create_agentsboolean

Whether members with this role can create new agents.

Example request

{
  "name": "Content Editor",
  "description": "Can manage content",
  "type": "local",
  "permissions": [
    "Create Conversation",
    "Export Conversation"
  ],
  "agents": [
    1,
    2
  ]
}

Response

Team role created successfully

status'error' | 'success'

The status of the response

Example response

{
  "status": "success",
  "data": {
    "id": 1,
    "name": "Content Editor",
    "description": "Can manage content",
    "type": "local",
    "has_access_to_projects": true,
    "agents": [
      1,
      2
    ],
    "permissions": [
      "Create Conversation",
      "Export Conversation"
    ],
    "created_at": "2023-04-30 16:43:53",
    "updated_at": "2023-04-30 16:43:53"
  }
}

Changes