Skip to main content
POST
/
agents
/
{agent_id}
/
tools
Attach Tool
curl --request POST \
  --url https://api.kejue.co/api/v1/agents/{agent_id}/tools \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "tool_name": "<string>",
  "tool_id": "<string>",
  "channels": [
    "voice:in-call"
  ],
  "config": {}
}
'
{
  "tool_name": "<string>",
  "channels": [
    "<string>"
  ],
  "config": {},
  "tool_id": "<string>"
}

Authorizations

X-API-Key
string
header
required

Workspace API key (e.g. kej_live_...)

Path Parameters

agent_id
string
required

Body

application/json

Attach a tool to an agent.

tool_name
string
required

Tool name — custom tool name or builtin name

tool_id
string | null

Tool ID — required for custom HTTP tools

channels
string[]

Channels where the tool is active: 'voice:in-call', 'voice:post-call', 'whatsapp'

config
Config · object

Tool-specific configuration. The shape depends on the tool — see the Tools guide for the full schema of each builtin.

Examples for selected builtins:

agent_transfer — transfer the live call to a different persona:

{
"targets": [
{
"key": "billing",
"persona_id": "<persona-uuid>",
"voice_config_id": "<voice-config-uuid>",
"when_to_use": "Caller has questions about invoices, refunds, or payments."
},
{
"key": "tech_support",
"persona_id": "<persona-uuid>",
"when_to_use": "Caller is reporting a technical issue with the product."
}
]
}

create_call — create a new outbound call from inside a conversation:

{
"default_persona_id": "<persona-uuid>",
"default_context": "Follow-up call about the contact's inquiry.",
"allow_persona_override": false
}

Response

Successful Response

A tool attached to an agent.

tool_name
string
required
channels
string[]
required
config
Config · object
required
tool_id
string | null