curl --request GET \
--url https://api.trugen.ai/v1/ext/agent/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.trugen.ai/v1/ext/agent/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.trugen.ai/v1/ext/agent/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trugen.ai/v1/ext/agent/{id}")
.header("x-api-key", "<api-key>")
.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::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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"
}
}
}
],
"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": "https://webhooks.example.com/agent-events",
"config": {
"systemPrompt": "Always respond with a concise solution first, then provide optional detail.",
"maxCallDuration": 1800,
"conversationalContext": "customer-support"
},
"knowledge_base": [
{
"id": "ac79226e-73e1-41fe-8cde-469ae4e244fa",
"name": "Product Support Articles",
"description": "Contains FAQs and troubleshooting guides for product lines."
}
],
"tool": [
{
"id": "ac79226e-73e1-41fe-8cde-469ae4e244fa",
"name": "Product Support Articles",
"description": "Tool for accessing employee directory."
}
],
"guardrail": [
{
"id": "dfbaa3c6-1e90-43df-869a-b023896a198c",
"key": "hate_speech_filter",
"name": "Hate Speech Filter",
"category": "Content Safety",
"prompt": "Trigger when the user uses hateful, discriminatory, or abusive language toward a person or group.",
"response_message": "I'm sorry, but I can't help with that. Let's keep things respectful.",
"callback_url": "https://yourapp.com/webhooks/guardrail"
}
],
"mcp": [
{
"id": "ac79226e-73e1-41fe-8cde-469ae4e244fa",
"name": "Product Support Articles",
"description": "MCP for accessing employee directory."
}
],
"record": true,
"created_at": "2025-12-01T10:20:30.000Z",
"updated_at": "2025-12-03T14:50:00.000Z"
}{
"error": "Unauthorized: not a valid authorization api key"
}{
"message": "Agent details not found"
}{
"error": "Failed to retrieve agent"
}Get Agent By Id
Retrieve an Agent by ID
curl --request GET \
--url https://api.trugen.ai/v1/ext/agent/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.trugen.ai/v1/ext/agent/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.trugen.ai/v1/ext/agent/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trugen.ai/v1/ext/agent/{id}")
.header("x-api-key", "<api-key>")
.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::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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"
}
}
}
],
"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": "https://webhooks.example.com/agent-events",
"config": {
"systemPrompt": "Always respond with a concise solution first, then provide optional detail.",
"maxCallDuration": 1800,
"conversationalContext": "customer-support"
},
"knowledge_base": [
{
"id": "ac79226e-73e1-41fe-8cde-469ae4e244fa",
"name": "Product Support Articles",
"description": "Contains FAQs and troubleshooting guides for product lines."
}
],
"tool": [
{
"id": "ac79226e-73e1-41fe-8cde-469ae4e244fa",
"name": "Product Support Articles",
"description": "Tool for accessing employee directory."
}
],
"guardrail": [
{
"id": "dfbaa3c6-1e90-43df-869a-b023896a198c",
"key": "hate_speech_filter",
"name": "Hate Speech Filter",
"category": "Content Safety",
"prompt": "Trigger when the user uses hateful, discriminatory, or abusive language toward a person or group.",
"response_message": "I'm sorry, but I can't help with that. Let's keep things respectful.",
"callback_url": "https://yourapp.com/webhooks/guardrail"
}
],
"mcp": [
{
"id": "ac79226e-73e1-41fe-8cde-469ae4e244fa",
"name": "Product Support Articles",
"description": "MCP for accessing employee directory."
}
],
"record": true,
"created_at": "2025-12-01T10:20:30.000Z",
"updated_at": "2025-12-03T14:50:00.000Z"
}{
"error": "Unauthorized: not a valid authorization api key"
}{
"message": "Agent details not found"
}{
"error": "Failed to retrieve agent"
}When to use
- Debugging: confirm the live configuration matches what you think it is
- Cloning: read a working agent, tweak, and re-create as a new agent
- Admin dashboards: build an internal view of your organization’s agents
- Backup: snapshot configuration before making changes
What’s returned
The full agent object as it exists on the server, including:- Top-level fields (
agent_name,agent_system_prompt,is_active,record,callback_url, etc.) - All configured avatars with STT, LLM, TTS, and turn-detection settings
- Attached knowledge bases (by ID)
- Attached tools and MCPs (by ID)
- Attached guardrails (full objects:
key,category,prompt,response_message,callback_url) - Widget configuration
Common gotchas
- The response can be large. Agents with many avatars, tools, and knowledge bases produce sizable responses. Cache aggressively on your side.
- Attachments are returned as IDs. Attached tools, knowledge bases, and MCPs are returned as IDs: fetch the individual resources separately if you need their full configuration.
- Not found returns 404. If the agent was deleted, the endpoint returns 404.
Next steps
Authorizations
Path Parameters
Unique identifier for the Agent
Response
Agent retrieved successfully
Unique identifier for the agent.
"b63c2a53-266b-4b43-a71b-7ea8b5e2e916"
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
Guardrails attached to this agent, returned in full (not by ID only).
Show child attributes
Show child attributes
List of MCP attached to this agent.
Show child attributes
Show child attributes
Determines whether voice call recordings should be stored.
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?