Skip to main content
PUT
/
api
/
agents
/
upsert
Upsert agent
curl --request PUT \
  --url http://localhost:8080/api/agents/upsert \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --header 'X-API-SECRET: <api-key>' \
  --data '
{
  "agent_name": "My Agent"
}
'
{
  "message": "Agent created successfully",
  "status": "success",
  "error": null,
  "data": {
    "operation": "created",
    "agent_id": "agent_12345678-1234-1234-1234-123456789012",
    "organization_id": "org_xyz789",
    "agent": {
      "agent_id": "agent_12345678-1234-1234-1234-123456789012",
      "organization_id": "org_xyz789",
      "agent_name": "My Agent",
      "begin_message": "Hello! How can I help you?",
      "created_at": "2025-01-15T10:30:00",
      "updated_at": "2025-01-15T10:30:00"
    }
  }
}

Authorizations

X-API-KEY
string
header
required

API Key for MCP server and external service authentication

X-API-SECRET
string
header
required

API Secret for MCP server and external service authentication

Body

application/json
agent_name
string
required
agent_id
string
organization_id
string
created_at
string<date-time>
updated_at
string<date-time>
begin_message
string
begin_message_variables
string[]
begin_message_delay_ms
integer<int32>
test_variables
object
webhook_url
string
post_call_webhook_id
string
end_call_after_silence_ms
integer<int32>
max_call_duration_ms
integer<int32>
take_turn_after_silence_seconds
number<double>
timezone
string
knowledge_base_ids
string[]
mcp_server_ids
string[]
rag_config
object
llm_config
object
stt_config
object
tts_config
object
post_call_analysis_data
object[]
post_call_analysis_model
string
post_call_evaluation_criteria
object[]
widget_config
object
access_info
object
fetch_webhook_data
boolean
use_rag
boolean
integrations
string[]
text_only
boolean
additional_languages
object[]

Response

Agent created or updated successfully

message
string
status
string
error
string | null
data
object