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": "ivy"
},
"input": {
"type": "audio",
"format": {
"encoding": "audio/pcm",
"sample_rate": 24000
},
"turn_detection": {},
"keyterms": [
"<string>"
]
},
"output": {
"type": "audio",
"voice": "ivy",
"format": {
"encoding": "audio/pcm",
"sample_rate": 24000
},
"volume": 123
},
"tools": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"http": {
"url": "<string>",
"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
}
],
"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"
}{
"detail": "Unauthorized"
}{
"detail": "Unauthorized"
}Agents
Retrieve an agent
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": "ivy"
},
"input": {
"type": "audio",
"format": {
"encoding": "audio/pcm",
"sample_rate": 24000
},
"turn_detection": {},
"keyterms": [
"<string>"
]
},
"output": {
"type": "audio",
"voice": "ivy",
"format": {
"encoding": "audio/pcm",
"sample_rate": 24000
},
"volume": 123
},
"tools": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"http": {
"url": "<string>",
"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
}
],
"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"
}{
"detail": "Unauthorized"
}{
"detail": "Unauthorized"
}Authorizations
Your AssemblyAI API key in the Authorization header. The raw key works directly; a Bearer prefix is also accepted.
Path Parameters
The agent's unique ID.
Example:
"7ad24396-b822-4dca-871a-be9cc4781cf9"
Response
The agent record.
A stored voice agent.
Example:
"7ad24396-b822-4dca-871a-be9cc4781cf9"
Example:
"Support Assistant"
Show child attributes
Show child attributes
Audio input configuration. Defaults to PCM at 24 kHz if omitted.
Show child attributes
Show child attributes
Audio output configuration. Defaults to PCM at 24 kHz with the agent's voice.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Connected LLM, if any. The api_key is write-only and never returned.
Show child attributes
Show child attributes
Was this page helpful?
⌘I