General Documentation
Agents
Agent Executions
Test Suites
Projects
WhatsApp Conversations
Customers
WhatsApp Configs
Agent Test Chats
Conversation Assignments
WhatsApp Templates
WhatsApp Contact Notes
Agent Snapshots
Agents
Update an agent
Updates an existing agent’s details
PATCH
/
agents
/
{agent_id}
Copy
curl --request PATCH \
--url https://app.kapso.ai/api/v1/agents/{agent_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"agent": {
"name": "Updated Agent Name",
"system_prompt": "You are a helpful assistant for our customers.",
"graph": {
"metadata": {},
"nodes": [
{
"id": "<string>",
"nodeable_id": "<string>",
"name": "<string>",
"type": "DefaultNode",
"prompt": "<string>",
"global": true,
"global_condition": "<string>",
"config": {},
"tool_ids": [
"<string>"
],
"webhook": {
"url": "<string>",
"http_method": "<string>",
"headers": {},
"body": {},
"mock_response": {},
"mock_response_enabled": true,
"headers_raw": "<string>",
"body_raw": "<string>",
"mock_response_raw": "<string>"
},
"whatsapp_template": {
"phone_number": "<string>",
"template_parameters": {},
"wait_for_response": true,
"whatsapp_config_id": "<string>",
"whatsapp_template_id": "<string>",
"whatsapp_node_id": "<string>"
},
"knowledge_base": {
"key": "<string>",
"knowledge_base_text": "<string>"
},
"warm_end": {
"timeout_minutes": 123
}
}
],
"edges": [
{
"id": "<string>",
"from": "<string>",
"to": "<string>",
"label": "<string>",
"conditions": {}
}
],
"tools": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"url": "<string>",
"method": "<string>",
"query_params": {},
"headers": {},
"body": {},
"description": "<string>"
}
]
}
}
}'
Copy
{
"data": {
"id": "agent-123abc",
"name": "Customer Support Agent",
"description": "Handles initial customer support queries",
"project_id": "project-456def",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
Authorizations
API key required for all endpoints
Path Parameters
Body
application/json
Response
200
application/json
Agent updated successfully
The response is of type object
.
Copy
curl --request PATCH \
--url https://app.kapso.ai/api/v1/agents/{agent_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"agent": {
"name": "Updated Agent Name",
"system_prompt": "You are a helpful assistant for our customers.",
"graph": {
"metadata": {},
"nodes": [
{
"id": "<string>",
"nodeable_id": "<string>",
"name": "<string>",
"type": "DefaultNode",
"prompt": "<string>",
"global": true,
"global_condition": "<string>",
"config": {},
"tool_ids": [
"<string>"
],
"webhook": {
"url": "<string>",
"http_method": "<string>",
"headers": {},
"body": {},
"mock_response": {},
"mock_response_enabled": true,
"headers_raw": "<string>",
"body_raw": "<string>",
"mock_response_raw": "<string>"
},
"whatsapp_template": {
"phone_number": "<string>",
"template_parameters": {},
"wait_for_response": true,
"whatsapp_config_id": "<string>",
"whatsapp_template_id": "<string>",
"whatsapp_node_id": "<string>"
},
"knowledge_base": {
"key": "<string>",
"knowledge_base_text": "<string>"
},
"warm_end": {
"timeout_minutes": 123
}
}
],
"edges": [
{
"id": "<string>",
"from": "<string>",
"to": "<string>",
"label": "<string>",
"conditions": {}
}
],
"tools": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"url": "<string>",
"method": "<string>",
"query_params": {},
"headers": {},
"body": {},
"description": "<string>"
}
]
}
}
}'
Copy
{
"data": {
"id": "agent-123abc",
"name": "Customer Support Agent",
"description": "Handles initial customer support queries",
"project_id": "project-456def",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
Assistant
Responses are generated using AI and may contain mistakes.