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>"
}
]
}
}
}'
{
"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"
}
}
Updates an existing agent’s details
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>"
}
]
}
}
}'
{
"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"
}
}
API key required for all endpoints
Agent updated successfully
The response is of type object
.
Was this page helpful?