Retrieve an agent
curl --request GET \
--url https://agents.assemblyai.com/v1/agents/{agent_id} \
--header 'Authorization: <api-key>'import requests
url = "https://agents.assemblyai.com/v1/agents/{agent_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://agents.assemblyai.com/v1/agents/{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://agents.assemblyai.com/v1/agents/{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 => [
"Authorization: <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://agents.assemblyai.com/v1/agents/{agent_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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://agents.assemblyai.com/v1/agents/{agent_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents.assemblyai.com/v1/agents/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "7ad24396-b822-4dca-871a-be9cc4781cf9",
"name": "Support Assistant",
"system_prompt": "<string>",
"greeting": "<string>",
"voice": {
"voice_id": "alba"
},
"input": {
"type": "audio",
"format": {
"encoding": "audio/pcm",
"sample_rate": 24000
},
"turn_detection": {},
"keyterms": [
"<string>"
]
},
"output": {
"type": "audio",
"voice": "alba",
"format": {
"encoding": "audio/pcm",
"sample_rate": 24000
},
"volume": 123
},
"tools": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"http": {
"url": "<string>",
"http_method": "GET",
"headers": {
"Authorization": "***"
}
},
"parameters": {
"type": "object",
"properties": {
"order_id": {
"type": "string",
"description": "The customer's order ID.",
"examples": [
"AB-12345"
],
"pattern": "[A-Z]{2}-\\d{5}"
}
},
"required": [
"order_id"
]
},
"timeout_seconds": 123,
"execution_mode": "interactive"
}
],
"llm": [
{
"base_url": "https://api.openai.com/v1",
"model": "gpt-4o-mini"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"pre_connect_requests": [
{
"http": {
"url": "<string>",
"http_method": "GET",
"headers": {
"Authorization": "***"
}
},
"sends": [
"<string>"
],
"returns": [
{
"name": "patient_name",
"path": "patient.first_name",
"default": "there"
}
],
"timeout_ms": 123,
"allow_overrides": [
"<string>"
]
}
]
}{
"detail": "Unauthorized"
}{
"detail": "Unauthorized"
}Endpoints
Retrieve an agent
Retrieve a single agent by ID. Tool header values are masked as "***" in the response.
GET
/
v1
/
agents
/
{agent_id}
Retrieve an agent
curl --request GET \
--url https://agents.assemblyai.com/v1/agents/{agent_id} \
--header 'Authorization: <api-key>'import requests
url = "https://agents.assemblyai.com/v1/agents/{agent_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://agents.assemblyai.com/v1/agents/{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://agents.assemblyai.com/v1/agents/{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 => [
"Authorization: <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://agents.assemblyai.com/v1/agents/{agent_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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://agents.assemblyai.com/v1/agents/{agent_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents.assemblyai.com/v1/agents/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "7ad24396-b822-4dca-871a-be9cc4781cf9",
"name": "Support Assistant",
"system_prompt": "<string>",
"greeting": "<string>",
"voice": {
"voice_id": "alba"
},
"input": {
"type": "audio",
"format": {
"encoding": "audio/pcm",
"sample_rate": 24000
},
"turn_detection": {},
"keyterms": [
"<string>"
]
},
"output": {
"type": "audio",
"voice": "alba",
"format": {
"encoding": "audio/pcm",
"sample_rate": 24000
},
"volume": 123
},
"tools": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"http": {
"url": "<string>",
"http_method": "GET",
"headers": {
"Authorization": "***"
}
},
"parameters": {
"type": "object",
"properties": {
"order_id": {
"type": "string",
"description": "The customer's order ID.",
"examples": [
"AB-12345"
],
"pattern": "[A-Z]{2}-\\d{5}"
}
},
"required": [
"order_id"
]
},
"timeout_seconds": 123,
"execution_mode": "interactive"
}
],
"llm": [
{
"base_url": "https://api.openai.com/v1",
"model": "gpt-4o-mini"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"pre_connect_requests": [
{
"http": {
"url": "<string>",
"http_method": "GET",
"headers": {
"Authorization": "***"
}
},
"sends": [
"<string>"
],
"returns": [
{
"name": "patient_name",
"path": "patient.first_name",
"default": "there"
}
],
"timeout_ms": 123,
"allow_overrides": [
"<string>"
]
}
]
}{
"detail": "Unauthorized"
}{
"detail": "Unauthorized"
}Authorizations
Path Parameters
Response
The agent record.
A stored voice agent.
Was this page helpful?