Create or Update an Agent using the Agent Builder
POST
/api/v2/agents/agentbuilder
Agentsv2
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v2/agents/agentbuilder' \
--header 'Content-Type: application/json' \
--data-raw '{
"history": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"agent_id": 1,
"project_id": 1,
"flags": {
"edit": true
},
"user_id": 1,
"caching_enabled": true
}'
Response Response Example
201 - Sample Response
{
"success": true,
"message": "Agent created successfully by Agent Builder",
"data": {
"response": "Hello! How can I assist you in building a custom agent today?",
"history": [
{
"role": "user",
"content": "hi"
},
{
"role": "ai",
"content": "Hello! How can I assist you in building a custom agent today?"
}
],
"agent_id": 0,
"agent_state": {
"agent_name": "Legal Consultant",
"prefix_prompt": "You are an AI assistant specializing in providing legal advice on regulatory requirements, compliance issues, and legal barriers to market entry.",
"agent_image": "/build/static/media/xyz123.png",
"description": "Legal advisor provides expert guidance on compliance audits, risk assessment, contract management, and regulatory requirements to ensure legal and operational excellence."
},
"new_image": false
}
}
Request
Body Params application/json