Skip to main content
POST
/
ai-agents
/
agents
Create BYO Agent
curl --request POST \
  --url https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agents \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "name": "<string>",
  "isActive": true,
  "integrateWith": "<string>",
  "integrationType": "llm",
  "actions": [
    "<string>"
  ],
  "tools": [
    "<string>"
  ],
  "icon": "<string>",
  "integrationMeta": {},
  "cometchatTools": [
    "<string>"
  ],
  "instruction": "<string>",
  "suggestions": [
    "<string>"
  ],
  "metaData": {}
}
'
{
  "agent": {
    "uid": "550e8400-e29b-41d4-a716-446655440000",
    "appId": "my-app-id",
    "name": "My Agent",
    "icon": "https://example.com/icon.png",
    "isActive": true,
    "integrateWith": "openai",
    "integrationType": "agent",
    "tools": [
      "tool1"
    ],
    "actions": [
      "action1"
    ],
    "instruction": "You are a helpful assistant",
    "integrationMeta": {},
    "metaData": {},
    "deletedAt": null,
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

apikey
string
header
required

API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).

Body

application/json
name
string
required

Name of the agent

isActive
boolean
default:true
required

Is the agent active?

integrateWith
string
required

ID of the LLM or platform this agent connects to

integrationType
enum<string>
required

Type of connection: llm or agent

Available options:
llm,
agent
actions
string[]
required

List of actions

tools
string[]
required

List of tools

icon
string

URL to the icon/avatar of the agent

integrationMeta
object

Required if integrationType is "agent". URL where the agent is deployed

cometchatTools
string[]

List of CometChat-provided tools

instruction
string

Instruction for the agent

suggestions
string[]

Array of suggestion texts for the agent

metaData
object

Optional metadata object for the agent

Response

Agent created successfully

agent
object