curl --request PUT \
--url https://api.trugen.ai/v1/ext/agent/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"id": "b63c2a53-266b-4b43-a71b-7ea8b5e2e916",
"agent_name": "Customer Support Agent",
"agent_system_prompt": "You are a helpful AI assistant that handles customer service inquiries.",
"avatars": [
{
"avatar_key_id": "1e4ea106",
"persona_name": "Sofia - Friendly Support",
"persona_prompt": "Speak in a warm, engaging tone and provide clear answers.",
"config": {
"llm": {
"model": "meta-llama/llama-4-maverick-17b-128e-instruct",
"provider": "groq"
},
"stt": {
"model": "flux-general-en",
"provider": "deepgram",
"min_endpointing_delay": 0.3,
"max_endpointing_delay": 0.4
},
"tts": {
"model_id": "eleven_turbo_v2_5",
"provider": "elevenlabs",
"voice_id": "ZUrEGyu8GFMwnHbvLhv2"
},
"turn_handling": "proactive",
"interruptability": "medium"
}
}
],
"callback_events": [
"participant_left",
"agent.started_speaking",
"agent.stopped_speaking",
"agent.interrupted",
"user.started_speaking",
"user.stopped_speaking",
"utterance_committed",
"max_call_duration_timeout"
],
"callback_url": "",
"config": {
"maxCallDuration": 1800,
"conversationalContext": "customer-support",
"memory": {
"isEnabled": false,
"instruction": "sample memory instruction for the agent"
}
},
"knowledge_base": [
{
"id": "ac79226e-73e1-41fe-8cde-469ae4e244fa",
"name": "Product Support Articles",
"description": "Contains FAQs and troubleshooting guides for product lines."
}
],
"guardrail": [
{
"id": "dfbaa3c6-1e90-43df-869a-b023896a198c",
"name": "Hate Speech Filter"
}
],
"record": true,
"is_active": true,
"created_at": "2025-12-01T10:20:30.000Z",
"updated_at": "2025-12-03T14:50:00.000Z"
}
'import requests
url = "https://api.trugen.ai/v1/ext/agent/{id}"
payload = {
"id": "b63c2a53-266b-4b43-a71b-7ea8b5e2e916",
"agent_name": "Customer Support Agent",
"agent_system_prompt": "You are a helpful AI assistant that handles customer service inquiries.",
"avatars": [
{
"avatar_key_id": "1e4ea106",
"persona_name": "Sofia - Friendly Support",
"persona_prompt": "Speak in a warm, engaging tone and provide clear answers.",
"config": {
"llm": {
"model": "meta-llama/llama-4-maverick-17b-128e-instruct",
"provider": "groq"
},
"stt": {
"model": "flux-general-en",
"provider": "deepgram",
"min_endpointing_delay": 0.3,
"max_endpointing_delay": 0.4
},
"tts": {
"model_id": "eleven_turbo_v2_5",
"provider": "elevenlabs",
"voice_id": "ZUrEGyu8GFMwnHbvLhv2"
},
"turn_handling": "proactive",
"interruptability": "medium"
}
}
],
"callback_events": ["participant_left", "agent.started_speaking", "agent.stopped_speaking", "agent.interrupted", "user.started_speaking", "user.stopped_speaking", "utterance_committed", "max_call_duration_timeout"],
"callback_url": "",
"config": {
"maxCallDuration": 1800,
"conversationalContext": "customer-support",
"memory": {
"isEnabled": False,
"instruction": "sample memory instruction for the agent"
}
},
"knowledge_base": [
{
"id": "ac79226e-73e1-41fe-8cde-469ae4e244fa",
"name": "Product Support Articles",
"description": "Contains FAQs and troubleshooting guides for product lines."
}
],
"guardrail": [
{
"id": "dfbaa3c6-1e90-43df-869a-b023896a198c",
"name": "Hate Speech Filter"
}
],
"record": True,
"is_active": True,
"created_at": "2025-12-01T10:20:30.000Z",
"updated_at": "2025-12-03T14:50:00.000Z"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'b63c2a53-266b-4b43-a71b-7ea8b5e2e916',
agent_name: 'Customer Support Agent',
agent_system_prompt: 'You are a helpful AI assistant that handles customer service inquiries.',
avatars: [
{
avatar_key_id: '1e4ea106',
persona_name: 'Sofia - Friendly Support',
persona_prompt: 'Speak in a warm, engaging tone and provide clear answers.',
config: {
llm: {model: 'meta-llama/llama-4-maverick-17b-128e-instruct', provider: 'groq'},
stt: {
model: 'flux-general-en',
provider: 'deepgram',
min_endpointing_delay: 0.3,
max_endpointing_delay: 0.4
},
tts: {
model_id: 'eleven_turbo_v2_5',
provider: 'elevenlabs',
voice_id: 'ZUrEGyu8GFMwnHbvLhv2'
},
turn_handling: 'proactive',
interruptability: 'medium'
}
}
],
callback_events: [
'participant_left',
'agent.started_speaking',
'agent.stopped_speaking',
'agent.interrupted',
'user.started_speaking',
'user.stopped_speaking',
'utterance_committed',
'max_call_duration_timeout'
],
callback_url: '',
config: {
maxCallDuration: 1800,
conversationalContext: 'customer-support',
memory: {isEnabled: false, instruction: 'sample memory instruction for the agent'}
},
knowledge_base: [
{
id: 'ac79226e-73e1-41fe-8cde-469ae4e244fa',
name: 'Product Support Articles',
description: 'Contains FAQs and troubleshooting guides for product lines.'
}
],
guardrail: [{id: 'dfbaa3c6-1e90-43df-869a-b023896a198c', name: 'Hate Speech Filter'}],
record: true,
is_active: true,
created_at: '2025-12-01T10:20:30.000Z',
updated_at: '2025-12-03T14:50:00.000Z'
})
};
fetch('https://api.trugen.ai/v1/ext/agent/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trugen.ai/v1/ext/agent/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'b63c2a53-266b-4b43-a71b-7ea8b5e2e916',
'agent_name' => 'Customer Support Agent',
'agent_system_prompt' => 'You are a helpful AI assistant that handles customer service inquiries.',
'avatars' => [
[
'avatar_key_id' => '1e4ea106',
'persona_name' => 'Sofia - Friendly Support',
'persona_prompt' => 'Speak in a warm, engaging tone and provide clear answers.',
'config' => [
'llm' => [
'model' => 'meta-llama/llama-4-maverick-17b-128e-instruct',
'provider' => 'groq'
],
'stt' => [
'model' => 'flux-general-en',
'provider' => 'deepgram',
'min_endpointing_delay' => 0.3,
'max_endpointing_delay' => 0.4
],
'tts' => [
'model_id' => 'eleven_turbo_v2_5',
'provider' => 'elevenlabs',
'voice_id' => 'ZUrEGyu8GFMwnHbvLhv2'
],
'turn_handling' => 'proactive',
'interruptability' => 'medium'
]
]
],
'callback_events' => [
'participant_left',
'agent.started_speaking',
'agent.stopped_speaking',
'agent.interrupted',
'user.started_speaking',
'user.stopped_speaking',
'utterance_committed',
'max_call_duration_timeout'
],
'callback_url' => '',
'config' => [
'maxCallDuration' => 1800,
'conversationalContext' => 'customer-support',
'memory' => [
'isEnabled' => false,
'instruction' => 'sample memory instruction for the agent'
]
],
'knowledge_base' => [
[
'id' => 'ac79226e-73e1-41fe-8cde-469ae4e244fa',
'name' => 'Product Support Articles',
'description' => 'Contains FAQs and troubleshooting guides for product lines.'
]
],
'guardrail' => [
[
'id' => 'dfbaa3c6-1e90-43df-869a-b023896a198c',
'name' => 'Hate Speech Filter'
]
],
'record' => true,
'is_active' => true,
'created_at' => '2025-12-01T10:20:30.000Z',
'updated_at' => '2025-12-03T14:50:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trugen.ai/v1/ext/agent/{id}"
payload := strings.NewReader("{\n \"id\": \"b63c2a53-266b-4b43-a71b-7ea8b5e2e916\",\n \"agent_name\": \"Customer Support Agent\",\n \"agent_system_prompt\": \"You are a helpful AI assistant that handles customer service inquiries.\",\n \"avatars\": [\n {\n \"avatar_key_id\": \"1e4ea106\",\n \"persona_name\": \"Sofia - Friendly Support\",\n \"persona_prompt\": \"Speak in a warm, engaging tone and provide clear answers.\",\n \"config\": {\n \"llm\": {\n \"model\": \"meta-llama/llama-4-maverick-17b-128e-instruct\",\n \"provider\": \"groq\"\n },\n \"stt\": {\n \"model\": \"flux-general-en\",\n \"provider\": \"deepgram\",\n \"min_endpointing_delay\": 0.3,\n \"max_endpointing_delay\": 0.4\n },\n \"tts\": {\n \"model_id\": \"eleven_turbo_v2_5\",\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"ZUrEGyu8GFMwnHbvLhv2\"\n },\n \"turn_handling\": \"proactive\",\n \"interruptability\": \"medium\"\n }\n }\n ],\n \"callback_events\": [\n \"participant_left\",\n \"agent.started_speaking\",\n \"agent.stopped_speaking\",\n \"agent.interrupted\",\n \"user.started_speaking\",\n \"user.stopped_speaking\",\n \"utterance_committed\",\n \"max_call_duration_timeout\"\n ],\n \"callback_url\": \"\",\n \"config\": {\n \"maxCallDuration\": 1800,\n \"conversationalContext\": \"customer-support\",\n \"memory\": {\n \"isEnabled\": false,\n \"instruction\": \"sample memory instruction for the agent\"\n }\n },\n \"knowledge_base\": [\n {\n \"id\": \"ac79226e-73e1-41fe-8cde-469ae4e244fa\",\n \"name\": \"Product Support Articles\",\n \"description\": \"Contains FAQs and troubleshooting guides for product lines.\"\n }\n ],\n \"guardrail\": [\n {\n \"id\": \"dfbaa3c6-1e90-43df-869a-b023896a198c\",\n \"name\": \"Hate Speech Filter\"\n }\n ],\n \"record\": true,\n \"is_active\": true,\n \"created_at\": \"2025-12-01T10:20:30.000Z\",\n \"updated_at\": \"2025-12-03T14:50:00.000Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.trugen.ai/v1/ext/agent/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"b63c2a53-266b-4b43-a71b-7ea8b5e2e916\",\n \"agent_name\": \"Customer Support Agent\",\n \"agent_system_prompt\": \"You are a helpful AI assistant that handles customer service inquiries.\",\n \"avatars\": [\n {\n \"avatar_key_id\": \"1e4ea106\",\n \"persona_name\": \"Sofia - Friendly Support\",\n \"persona_prompt\": \"Speak in a warm, engaging tone and provide clear answers.\",\n \"config\": {\n \"llm\": {\n \"model\": \"meta-llama/llama-4-maverick-17b-128e-instruct\",\n \"provider\": \"groq\"\n },\n \"stt\": {\n \"model\": \"flux-general-en\",\n \"provider\": \"deepgram\",\n \"min_endpointing_delay\": 0.3,\n \"max_endpointing_delay\": 0.4\n },\n \"tts\": {\n \"model_id\": \"eleven_turbo_v2_5\",\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"ZUrEGyu8GFMwnHbvLhv2\"\n },\n \"turn_handling\": \"proactive\",\n \"interruptability\": \"medium\"\n }\n }\n ],\n \"callback_events\": [\n \"participant_left\",\n \"agent.started_speaking\",\n \"agent.stopped_speaking\",\n \"agent.interrupted\",\n \"user.started_speaking\",\n \"user.stopped_speaking\",\n \"utterance_committed\",\n \"max_call_duration_timeout\"\n ],\n \"callback_url\": \"\",\n \"config\": {\n \"maxCallDuration\": 1800,\n \"conversationalContext\": \"customer-support\",\n \"memory\": {\n \"isEnabled\": false,\n \"instruction\": \"sample memory instruction for the agent\"\n }\n },\n \"knowledge_base\": [\n {\n \"id\": \"ac79226e-73e1-41fe-8cde-469ae4e244fa\",\n \"name\": \"Product Support Articles\",\n \"description\": \"Contains FAQs and troubleshooting guides for product lines.\"\n }\n ],\n \"guardrail\": [\n {\n \"id\": \"dfbaa3c6-1e90-43df-869a-b023896a198c\",\n \"name\": \"Hate Speech Filter\"\n }\n ],\n \"record\": true,\n \"is_active\": true,\n \"created_at\": \"2025-12-01T10:20:30.000Z\",\n \"updated_at\": \"2025-12-03T14:50:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trugen.ai/v1/ext/agent/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"b63c2a53-266b-4b43-a71b-7ea8b5e2e916\",\n \"agent_name\": \"Customer Support Agent\",\n \"agent_system_prompt\": \"You are a helpful AI assistant that handles customer service inquiries.\",\n \"avatars\": [\n {\n \"avatar_key_id\": \"1e4ea106\",\n \"persona_name\": \"Sofia - Friendly Support\",\n \"persona_prompt\": \"Speak in a warm, engaging tone and provide clear answers.\",\n \"config\": {\n \"llm\": {\n \"model\": \"meta-llama/llama-4-maverick-17b-128e-instruct\",\n \"provider\": \"groq\"\n },\n \"stt\": {\n \"model\": \"flux-general-en\",\n \"provider\": \"deepgram\",\n \"min_endpointing_delay\": 0.3,\n \"max_endpointing_delay\": 0.4\n },\n \"tts\": {\n \"model_id\": \"eleven_turbo_v2_5\",\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"ZUrEGyu8GFMwnHbvLhv2\"\n },\n \"turn_handling\": \"proactive\",\n \"interruptability\": \"medium\"\n }\n }\n ],\n \"callback_events\": [\n \"participant_left\",\n \"agent.started_speaking\",\n \"agent.stopped_speaking\",\n \"agent.interrupted\",\n \"user.started_speaking\",\n \"user.stopped_speaking\",\n \"utterance_committed\",\n \"max_call_duration_timeout\"\n ],\n \"callback_url\": \"\",\n \"config\": {\n \"maxCallDuration\": 1800,\n \"conversationalContext\": \"customer-support\",\n \"memory\": {\n \"isEnabled\": false,\n \"instruction\": \"sample memory instruction for the agent\"\n }\n },\n \"knowledge_base\": [\n {\n \"id\": \"ac79226e-73e1-41fe-8cde-469ae4e244fa\",\n \"name\": \"Product Support Articles\",\n \"description\": \"Contains FAQs and troubleshooting guides for product lines.\"\n }\n ],\n \"guardrail\": [\n {\n \"id\": \"dfbaa3c6-1e90-43df-869a-b023896a198c\",\n \"name\": \"Hate Speech Filter\"\n }\n ],\n \"record\": true,\n \"is_active\": true,\n \"created_at\": \"2025-12-01T10:20:30.000Z\",\n \"updated_at\": \"2025-12-03T14:50:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "098f083e-64c3-4c84-b3af-1b3e0b2538b3",
"message": "Agent updated successfully"
}{
"error": "Invalid request body"
}{
"error": "Unauthorized: not a valid authorization api key"
}{
"message": "Agent details not found"
}{
"error": "Failed to update agent"
}Update Agent
Updates an Agent with new avatar, knowledge base, or system settings.
curl --request PUT \
--url https://api.trugen.ai/v1/ext/agent/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"id": "b63c2a53-266b-4b43-a71b-7ea8b5e2e916",
"agent_name": "Customer Support Agent",
"agent_system_prompt": "You are a helpful AI assistant that handles customer service inquiries.",
"avatars": [
{
"avatar_key_id": "1e4ea106",
"persona_name": "Sofia - Friendly Support",
"persona_prompt": "Speak in a warm, engaging tone and provide clear answers.",
"config": {
"llm": {
"model": "meta-llama/llama-4-maverick-17b-128e-instruct",
"provider": "groq"
},
"stt": {
"model": "flux-general-en",
"provider": "deepgram",
"min_endpointing_delay": 0.3,
"max_endpointing_delay": 0.4
},
"tts": {
"model_id": "eleven_turbo_v2_5",
"provider": "elevenlabs",
"voice_id": "ZUrEGyu8GFMwnHbvLhv2"
},
"turn_handling": "proactive",
"interruptability": "medium"
}
}
],
"callback_events": [
"participant_left",
"agent.started_speaking",
"agent.stopped_speaking",
"agent.interrupted",
"user.started_speaking",
"user.stopped_speaking",
"utterance_committed",
"max_call_duration_timeout"
],
"callback_url": "",
"config": {
"maxCallDuration": 1800,
"conversationalContext": "customer-support",
"memory": {
"isEnabled": false,
"instruction": "sample memory instruction for the agent"
}
},
"knowledge_base": [
{
"id": "ac79226e-73e1-41fe-8cde-469ae4e244fa",
"name": "Product Support Articles",
"description": "Contains FAQs and troubleshooting guides for product lines."
}
],
"guardrail": [
{
"id": "dfbaa3c6-1e90-43df-869a-b023896a198c",
"name": "Hate Speech Filter"
}
],
"record": true,
"is_active": true,
"created_at": "2025-12-01T10:20:30.000Z",
"updated_at": "2025-12-03T14:50:00.000Z"
}
'import requests
url = "https://api.trugen.ai/v1/ext/agent/{id}"
payload = {
"id": "b63c2a53-266b-4b43-a71b-7ea8b5e2e916",
"agent_name": "Customer Support Agent",
"agent_system_prompt": "You are a helpful AI assistant that handles customer service inquiries.",
"avatars": [
{
"avatar_key_id": "1e4ea106",
"persona_name": "Sofia - Friendly Support",
"persona_prompt": "Speak in a warm, engaging tone and provide clear answers.",
"config": {
"llm": {
"model": "meta-llama/llama-4-maverick-17b-128e-instruct",
"provider": "groq"
},
"stt": {
"model": "flux-general-en",
"provider": "deepgram",
"min_endpointing_delay": 0.3,
"max_endpointing_delay": 0.4
},
"tts": {
"model_id": "eleven_turbo_v2_5",
"provider": "elevenlabs",
"voice_id": "ZUrEGyu8GFMwnHbvLhv2"
},
"turn_handling": "proactive",
"interruptability": "medium"
}
}
],
"callback_events": ["participant_left", "agent.started_speaking", "agent.stopped_speaking", "agent.interrupted", "user.started_speaking", "user.stopped_speaking", "utterance_committed", "max_call_duration_timeout"],
"callback_url": "",
"config": {
"maxCallDuration": 1800,
"conversationalContext": "customer-support",
"memory": {
"isEnabled": False,
"instruction": "sample memory instruction for the agent"
}
},
"knowledge_base": [
{
"id": "ac79226e-73e1-41fe-8cde-469ae4e244fa",
"name": "Product Support Articles",
"description": "Contains FAQs and troubleshooting guides for product lines."
}
],
"guardrail": [
{
"id": "dfbaa3c6-1e90-43df-869a-b023896a198c",
"name": "Hate Speech Filter"
}
],
"record": True,
"is_active": True,
"created_at": "2025-12-01T10:20:30.000Z",
"updated_at": "2025-12-03T14:50:00.000Z"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'b63c2a53-266b-4b43-a71b-7ea8b5e2e916',
agent_name: 'Customer Support Agent',
agent_system_prompt: 'You are a helpful AI assistant that handles customer service inquiries.',
avatars: [
{
avatar_key_id: '1e4ea106',
persona_name: 'Sofia - Friendly Support',
persona_prompt: 'Speak in a warm, engaging tone and provide clear answers.',
config: {
llm: {model: 'meta-llama/llama-4-maverick-17b-128e-instruct', provider: 'groq'},
stt: {
model: 'flux-general-en',
provider: 'deepgram',
min_endpointing_delay: 0.3,
max_endpointing_delay: 0.4
},
tts: {
model_id: 'eleven_turbo_v2_5',
provider: 'elevenlabs',
voice_id: 'ZUrEGyu8GFMwnHbvLhv2'
},
turn_handling: 'proactive',
interruptability: 'medium'
}
}
],
callback_events: [
'participant_left',
'agent.started_speaking',
'agent.stopped_speaking',
'agent.interrupted',
'user.started_speaking',
'user.stopped_speaking',
'utterance_committed',
'max_call_duration_timeout'
],
callback_url: '',
config: {
maxCallDuration: 1800,
conversationalContext: 'customer-support',
memory: {isEnabled: false, instruction: 'sample memory instruction for the agent'}
},
knowledge_base: [
{
id: 'ac79226e-73e1-41fe-8cde-469ae4e244fa',
name: 'Product Support Articles',
description: 'Contains FAQs and troubleshooting guides for product lines.'
}
],
guardrail: [{id: 'dfbaa3c6-1e90-43df-869a-b023896a198c', name: 'Hate Speech Filter'}],
record: true,
is_active: true,
created_at: '2025-12-01T10:20:30.000Z',
updated_at: '2025-12-03T14:50:00.000Z'
})
};
fetch('https://api.trugen.ai/v1/ext/agent/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trugen.ai/v1/ext/agent/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'b63c2a53-266b-4b43-a71b-7ea8b5e2e916',
'agent_name' => 'Customer Support Agent',
'agent_system_prompt' => 'You are a helpful AI assistant that handles customer service inquiries.',
'avatars' => [
[
'avatar_key_id' => '1e4ea106',
'persona_name' => 'Sofia - Friendly Support',
'persona_prompt' => 'Speak in a warm, engaging tone and provide clear answers.',
'config' => [
'llm' => [
'model' => 'meta-llama/llama-4-maverick-17b-128e-instruct',
'provider' => 'groq'
],
'stt' => [
'model' => 'flux-general-en',
'provider' => 'deepgram',
'min_endpointing_delay' => 0.3,
'max_endpointing_delay' => 0.4
],
'tts' => [
'model_id' => 'eleven_turbo_v2_5',
'provider' => 'elevenlabs',
'voice_id' => 'ZUrEGyu8GFMwnHbvLhv2'
],
'turn_handling' => 'proactive',
'interruptability' => 'medium'
]
]
],
'callback_events' => [
'participant_left',
'agent.started_speaking',
'agent.stopped_speaking',
'agent.interrupted',
'user.started_speaking',
'user.stopped_speaking',
'utterance_committed',
'max_call_duration_timeout'
],
'callback_url' => '',
'config' => [
'maxCallDuration' => 1800,
'conversationalContext' => 'customer-support',
'memory' => [
'isEnabled' => false,
'instruction' => 'sample memory instruction for the agent'
]
],
'knowledge_base' => [
[
'id' => 'ac79226e-73e1-41fe-8cde-469ae4e244fa',
'name' => 'Product Support Articles',
'description' => 'Contains FAQs and troubleshooting guides for product lines.'
]
],
'guardrail' => [
[
'id' => 'dfbaa3c6-1e90-43df-869a-b023896a198c',
'name' => 'Hate Speech Filter'
]
],
'record' => true,
'is_active' => true,
'created_at' => '2025-12-01T10:20:30.000Z',
'updated_at' => '2025-12-03T14:50:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trugen.ai/v1/ext/agent/{id}"
payload := strings.NewReader("{\n \"id\": \"b63c2a53-266b-4b43-a71b-7ea8b5e2e916\",\n \"agent_name\": \"Customer Support Agent\",\n \"agent_system_prompt\": \"You are a helpful AI assistant that handles customer service inquiries.\",\n \"avatars\": [\n {\n \"avatar_key_id\": \"1e4ea106\",\n \"persona_name\": \"Sofia - Friendly Support\",\n \"persona_prompt\": \"Speak in a warm, engaging tone and provide clear answers.\",\n \"config\": {\n \"llm\": {\n \"model\": \"meta-llama/llama-4-maverick-17b-128e-instruct\",\n \"provider\": \"groq\"\n },\n \"stt\": {\n \"model\": \"flux-general-en\",\n \"provider\": \"deepgram\",\n \"min_endpointing_delay\": 0.3,\n \"max_endpointing_delay\": 0.4\n },\n \"tts\": {\n \"model_id\": \"eleven_turbo_v2_5\",\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"ZUrEGyu8GFMwnHbvLhv2\"\n },\n \"turn_handling\": \"proactive\",\n \"interruptability\": \"medium\"\n }\n }\n ],\n \"callback_events\": [\n \"participant_left\",\n \"agent.started_speaking\",\n \"agent.stopped_speaking\",\n \"agent.interrupted\",\n \"user.started_speaking\",\n \"user.stopped_speaking\",\n \"utterance_committed\",\n \"max_call_duration_timeout\"\n ],\n \"callback_url\": \"\",\n \"config\": {\n \"maxCallDuration\": 1800,\n \"conversationalContext\": \"customer-support\",\n \"memory\": {\n \"isEnabled\": false,\n \"instruction\": \"sample memory instruction for the agent\"\n }\n },\n \"knowledge_base\": [\n {\n \"id\": \"ac79226e-73e1-41fe-8cde-469ae4e244fa\",\n \"name\": \"Product Support Articles\",\n \"description\": \"Contains FAQs and troubleshooting guides for product lines.\"\n }\n ],\n \"guardrail\": [\n {\n \"id\": \"dfbaa3c6-1e90-43df-869a-b023896a198c\",\n \"name\": \"Hate Speech Filter\"\n }\n ],\n \"record\": true,\n \"is_active\": true,\n \"created_at\": \"2025-12-01T10:20:30.000Z\",\n \"updated_at\": \"2025-12-03T14:50:00.000Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.trugen.ai/v1/ext/agent/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"b63c2a53-266b-4b43-a71b-7ea8b5e2e916\",\n \"agent_name\": \"Customer Support Agent\",\n \"agent_system_prompt\": \"You are a helpful AI assistant that handles customer service inquiries.\",\n \"avatars\": [\n {\n \"avatar_key_id\": \"1e4ea106\",\n \"persona_name\": \"Sofia - Friendly Support\",\n \"persona_prompt\": \"Speak in a warm, engaging tone and provide clear answers.\",\n \"config\": {\n \"llm\": {\n \"model\": \"meta-llama/llama-4-maverick-17b-128e-instruct\",\n \"provider\": \"groq\"\n },\n \"stt\": {\n \"model\": \"flux-general-en\",\n \"provider\": \"deepgram\",\n \"min_endpointing_delay\": 0.3,\n \"max_endpointing_delay\": 0.4\n },\n \"tts\": {\n \"model_id\": \"eleven_turbo_v2_5\",\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"ZUrEGyu8GFMwnHbvLhv2\"\n },\n \"turn_handling\": \"proactive\",\n \"interruptability\": \"medium\"\n }\n }\n ],\n \"callback_events\": [\n \"participant_left\",\n \"agent.started_speaking\",\n \"agent.stopped_speaking\",\n \"agent.interrupted\",\n \"user.started_speaking\",\n \"user.stopped_speaking\",\n \"utterance_committed\",\n \"max_call_duration_timeout\"\n ],\n \"callback_url\": \"\",\n \"config\": {\n \"maxCallDuration\": 1800,\n \"conversationalContext\": \"customer-support\",\n \"memory\": {\n \"isEnabled\": false,\n \"instruction\": \"sample memory instruction for the agent\"\n }\n },\n \"knowledge_base\": [\n {\n \"id\": \"ac79226e-73e1-41fe-8cde-469ae4e244fa\",\n \"name\": \"Product Support Articles\",\n \"description\": \"Contains FAQs and troubleshooting guides for product lines.\"\n }\n ],\n \"guardrail\": [\n {\n \"id\": \"dfbaa3c6-1e90-43df-869a-b023896a198c\",\n \"name\": \"Hate Speech Filter\"\n }\n ],\n \"record\": true,\n \"is_active\": true,\n \"created_at\": \"2025-12-01T10:20:30.000Z\",\n \"updated_at\": \"2025-12-03T14:50:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trugen.ai/v1/ext/agent/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"b63c2a53-266b-4b43-a71b-7ea8b5e2e916\",\n \"agent_name\": \"Customer Support Agent\",\n \"agent_system_prompt\": \"You are a helpful AI assistant that handles customer service inquiries.\",\n \"avatars\": [\n {\n \"avatar_key_id\": \"1e4ea106\",\n \"persona_name\": \"Sofia - Friendly Support\",\n \"persona_prompt\": \"Speak in a warm, engaging tone and provide clear answers.\",\n \"config\": {\n \"llm\": {\n \"model\": \"meta-llama/llama-4-maverick-17b-128e-instruct\",\n \"provider\": \"groq\"\n },\n \"stt\": {\n \"model\": \"flux-general-en\",\n \"provider\": \"deepgram\",\n \"min_endpointing_delay\": 0.3,\n \"max_endpointing_delay\": 0.4\n },\n \"tts\": {\n \"model_id\": \"eleven_turbo_v2_5\",\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"ZUrEGyu8GFMwnHbvLhv2\"\n },\n \"turn_handling\": \"proactive\",\n \"interruptability\": \"medium\"\n }\n }\n ],\n \"callback_events\": [\n \"participant_left\",\n \"agent.started_speaking\",\n \"agent.stopped_speaking\",\n \"agent.interrupted\",\n \"user.started_speaking\",\n \"user.stopped_speaking\",\n \"utterance_committed\",\n \"max_call_duration_timeout\"\n ],\n \"callback_url\": \"\",\n \"config\": {\n \"maxCallDuration\": 1800,\n \"conversationalContext\": \"customer-support\",\n \"memory\": {\n \"isEnabled\": false,\n \"instruction\": \"sample memory instruction for the agent\"\n }\n },\n \"knowledge_base\": [\n {\n \"id\": \"ac79226e-73e1-41fe-8cde-469ae4e244fa\",\n \"name\": \"Product Support Articles\",\n \"description\": \"Contains FAQs and troubleshooting guides for product lines.\"\n }\n ],\n \"guardrail\": [\n {\n \"id\": \"dfbaa3c6-1e90-43df-869a-b023896a198c\",\n \"name\": \"Hate Speech Filter\"\n }\n ],\n \"record\": true,\n \"is_active\": true,\n \"created_at\": \"2025-12-01T10:20:30.000Z\",\n \"updated_at\": \"2025-12-03T14:50:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "098f083e-64c3-4c84-b3af-1b3e0b2538b3",
"message": "Agent updated successfully"
}{
"error": "Invalid request body"
}{
"error": "Unauthorized: not a valid authorization api key"
}{
"message": "Agent details not found"
}{
"error": "Failed to update agent"
}PUT is a full-replace: send the complete configuration, not a partial. For partial updates, use PATCH /ext/agent/{id}.
When to use PUT vs PATCH
| Endpoint | Behavior | Use when |
|---|---|---|
PUT /ext/agent/{id} | Full replace: omitted fields reset to defaults | You want to re-declare the full agent state |
PATCH /ext/agent/{id} | Partial merge: only send changed fields | You want to update one field without touching others |
Effect on live sessions
Updates take effect on the next session: existing active sessions keep the previous configuration until they end. If you need to force a config change immediately, end active sessions withDELETE /v1/conversation/{conversationId} after the update lands.
Common patterns
Change the prompt without touching anything else
curl --request PATCH \
--url https://api.trugen.ai/v1/ext/agent/{id} \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"agent_system_prompt": "You are Priya, a friendly nutritionist AI…"
}'
Swap the LLM provider
curl --request PATCH \
--url https://api.trugen.ai/v1/ext/agent/{id} \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"avatars": [
{
"llm": {
"provider": "groq",
"model": "openai/gpt-oss-120b",
"fallback_model": "gpt-5.4-mini"
}
}
]
}'
Deactivate without deleting
curl --request PATCH \
--url https://api.trugen.ai/v1/ext/agent/{id} \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{ "is_active": false }'
Next steps
Authorizations
Path Parameters
Unique identifier for the Agent
Body
Display name of the agent.
"Customer Support Agent"
Foundational system instruction used by this agent.
"You are a helpful AI assistant that handles customer service inquiries."
List of avatars associated with this agent.
Show child attributes
Show child attributes
Webhook events that should trigger callbacks.
[
"participant_left",
"agent.started_speaking",
"agent.stopped_speaking",
"agent.interrupted",
"user.started_speaking",
"user.stopped_speaking",
"utterance_committed",
"max_call_duration_timeout"
]
Webhook endpoint URL to send callback events to.
"https://webhooks.example.com/agent-events"
Agent-level configuration properties.
Show child attributes
Show child attributes
List of knowledge bases attached to this agent.
Show child attributes
Show child attributes
List of tools attached to this agent.
Show child attributes
Show child attributes
List of guardrails attached to this agent.
Show child attributes
Show child attributes
List of MCPs attached to this agent.
Show child attributes
Show child attributes
Determines whether voice call recordings should be stored.
true
Determines whether this record is active or not.
true
Timestamp indicating when the agent was created.
"2025-12-01T10:20:30.000Z"
Last updated timestamp for the agent.
"2025-12-03T14:50:00.000Z"
Was this page helpful?