Skip to main content
Version: 2.0

Replace Agent API Definition

The Replace Agent API enables you to completely replace an existing agent's configuration, including its corpora, tools, and generation presets. This endpoint performs a full replacement of the agent definition, unlike the Update Agent API which only modifies specified fields.

Endpoint: PUT /v2/agents/{agent_key}

Path Parameters

ParameterTypeDescription
agent_keystringThe unique key of the agent to replace

Request Body

The request body should contain a complete agent definition with all required fields:

REPLACE AGENT REQUEST
1

Response

{
"key": "agt_customer_support_123",
"name": "updated-customer-support",
"description": "Updated customer support agent with new capabilities",
"tool_configurations": {
"support_search": {
"type": "corpora_search",
"query_configuration": {
"search": {
"corpora": [{"corpus_key": "support-docs-v2"}],
"limit": 5
}
}
},
"web_search": {
"type": "web_search",
"argument_override": {
"limit": 10
}
}
},
"first_step": {
"type": "conversational",
"instructions": [{
"type": "inline",
"name": "inl_support_001",
"description": "Support assistant instruction",
"template": "You are a customer support assistant. Always be helpful and search internal docs first.",
"enabled": true
}],
"output_parser": {
"type": "default"
}
},
"model": {
"name": "gpt-4",
"parameters": {
"temperature": 0.3,
"max_tokens": 1000
}
},
"metadata": {
"version": "2.0",
"team": "support"
},
"enabled": true,
"created_at": "2025-01-14T10:00:00.000Z"
}

Usage Examples

REPLACE AGENT WITH CURL
1

Difference from Update Agent

  • Replace Agent (PUT): Completely replaces the entire agent configuration
  • Update Agent (PATCH): Only modifies specified fields, leaving others unchanged

Use Replace Agent when you want to:

  • Completely redefine an agent's configuration
  • Ensure the agent has only the specified tools and settings
  • Reset all fields to new values