Agents
Update agent
Modifies an existing agent's configuration with partial updates. Supports updating any aspect of the agent including model assignments (primary and fallback), instructions, tools, knowledge bases, memory stores, and execution parameters. Only the fields provided in the request body will be updated; all other fields remain unchanged. Changes take effect immediately for new agent invocations.
patch/v2/agents/{agent_key}
Path parameters
agent_keystring required
The unique key of the agent to update
The unique key of the agent to update
Request body
Example request
{
"model": {
"parameters": {
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"cache": {
"ttl": 3600
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
},
"timeout": {
"call_timeout": 30000
}
},
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
}
},
"fallback_models": [
{
"parameters": {
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"cache": {
"ttl": 3600
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
},
"timeout": {
"call_timeout": 30000
}
},
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
}
}
],
"settings": {
"tools": [
{
"type": "mcp",
"id": "01KA84ND5J0SWQMA2Q8HY5WZZZ",
"tool_id": "01KXYZ123456789",
"requires_approval": false
}
]
},
"path": "Default",
"knowledge_bases": [
{
"knowledge_id": "customer-knowledge-base"
}
]
}Response
Agent configuration successfully updated. Returns the complete updated agent manifest reflecting all changes made.
Example response
{
"path": "Default",
"knowledge_bases": [
{
"knowledge_id": "customer-knowledge-base"
}
],
"model": {
"parameters": {
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"cache": {
"ttl": 3600
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
},
"timeout": {
"call_timeout": 30000
}
},
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"fallback_models": [
{
"parameters": {
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"cache": {
"ttl": 3600
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
},
"timeout": {
"call_timeout": 30000
}
},
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
}
}
]
}
}