Skip to main content
POST
/
ai-agents
/
agent-builder
/
agents
Create Agent
curl --request POST \
  --url https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/agents \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "isActive": true,
  "icon": "<string>",
  "tools": [],
  "apiTools": [],
  "mcpServers": [],
  "instruction": "<string>",
  "metaData": {},
  "model": "gpt-4o-mini",
  "modelMetaData": {}
}
'
{
  "agent": {
    "uid": "agent-uuid-1234",
    "appId": "my-app-id",
    "name": "Support Agent",
    "icon": "https://example.com/icon.png",
    "isActive": true,
    "description": "A helpful support agent",
    "tools": [
      "gmail",
      "slack"
    ],
    "files": [],
    "websites": [],
    "otherKbIntegrations": [],
    "apiTools": [],
    "mcpServers": [],
    "frontendActions": [],
    "ragVersion": "v2",
    "lastMessageAt": 1700000000000,
    "instruction": "You are a helpful assistant",
    "formattedInstruction": "You are a helpful assistant",
    "metaData": {},
    "model": "gpt-4o-mini",
    "modelMetaData": {},
    "createdAt": 1700000000000,
    "updatedAt": 1700000000000
  }
}

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

description
string
required

Description of the agent

isActive
boolean
default:true
required

Is the agent active?

icon
string

URL to the icon/avatar of the agent

tools
string[]

Array of tool names available to this agent

apiTools
string[]

Array of API tool names available to this agent

mcpServers
string[]

Array of MCP server names available to this agent

instruction
string

Instructions for the agent behavior

metaData
object

Additional metadata for the agent

model
string
default:gpt-4o-mini

AI model to use for this agent

modelMetaData
object

Configuration metadata for the AI model

Response

Agent created successfully

agent
object