Agent
Get All Agents
Retrieve all AI agents configured in your organization
GET
/
api
/
v2
/
platform
/
agents
/
Get All Agents
curl --request GET \
--url https://unpod.ai/api/v2/platform/agents/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/agents/"
headers = {
"Org-Handle": "<org-handle>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Org-Handle': '<org-handle>', Authorization: '<api-key>'}
};
fetch('https://unpod.ai/api/v2/platform/agents/', 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://unpod.ai/api/v2/platform/agents/",
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>",
"Org-Handle: <org-handle>"
],
]);
$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://unpod.ai/api/v2/platform/agents/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Org-Handle", "<org-handle>")
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://unpod.ai/api/v2/platform/agents/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/agents/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Org-Handle"] = '<org-handle>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 94,
"status_code": 200,
"message": "Agents fetched successfully",
"data": [
{
"handle": "space-agent-8qmk42nslp91wrh3dz7btxc4",
"name": "General Agentic",
"type": "Voice",
"state": "published",
"purpose": "Handle outbound sales calls"
}
]
}
{
"status_code": 401,
"message": "Authentication credentials were not provided."
}
{
"count": 94,
"status_code": 200,
"message": "Agents fetched successfully",
"data": [
{
"handle": "space-agent-8qmk42nslp91wrh3dz7btxc4",
"name": "General Agentic",
"type": "Voice",
"state": "published",
"purpose": "Handle outbound sales calls"
}
]
}
{
"status_code": 401,
"message": "Authentication credentials were not provided."
}
Get All Agents
Retrieve detailed information for all registered AI agents in your organization, helping you view and manage agent records within the system.Prerequisites: Make sure you have your API Token and Org-Handle ready. See Authentication for details.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | API Key format: Token <token> |
| Org-Handle | string | Yes | Organization domain handle |
You can get the
Org-Handle by hitting the Get All Organizations API. The domain_handle field in the response is your Org-Handle.Response Fields
| Field | Type | Description |
|---|---|---|
| count | integer | Total number of agents |
| status_code | integer | HTTP status code |
| message | string | Response message |
| data | array | Array of agent objects |
Agent Object Fields
| Field | Type | Description |
|---|---|---|
| handle | string | Unique agent handle/identifier |
| name | string | Agent display name |
| type | string | Agent type: Voice, Chat, etc. |
| state | string | Agent state: published, draft, archived |
| purpose | string | Agent purpose/use case description |
Common Error Codes
| Status Code | Description |
|---|---|
| 200 | Success - Request completed successfully |
| 400 | Bad Request - Invalid parameters provided |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Access denied to the resource |
| 404 | Not Found - Organization not found |
| 500 | Internal Server Error - Server-side error |
Code Examples
const axios = require('axios');
const headers = {
'Authorization': 'Token your-api-token',
'Org-Handle': 'your-org-handle'
};
// Get all agents
const getAllAgents = async () => {
const response = await axios.get(
'https://unpod.ai/api/v2/platform/agents/',
{ headers }
);
console.log(`Total agents: ${response.data.count}`);
response.data.data.forEach(agent => {
console.log(`${agent.name} (${agent.handle}) - ${agent.state}`);
});
return response.data.data;
};
// Example usage
getAllAgents();
import requests
headers = {
'Authorization': 'Token your-api-token',
'Org-Handle': 'your-org-handle'
}
def get_all_agents():
"""Get all AI agents in the organization"""
url = 'https://unpod.ai/api/v2/platform/agents/'
response = requests.get(url, headers=headers)
data = response.json()
print(f"Total agents: {data['count']}")
for agent in data['data']:
print(f"{agent['name']} ({agent['handle']}) - {agent['state']}")
return data['data']
# Example usage
get_all_agents()
# Get all agents
curl -X GET "https://unpod.ai/api/v2/platform/agents/" \
-H "Authorization: Token your-api-token" \
-H "Org-Handle: your-org-handle"
Best Practices
- Agent Handle: Note the
handlefield - it is used as theagent_handlepath parameter in other agent endpoints - State Filtering: Filter by
statein your application to show onlypublishedagents - Org-Handle: Always include the correct organization handle in requests
- Error Handling: Always handle potential errors and edge cases
- Security: Keep API tokens secure and rotate them regularly
Was this page helpful?
⌘I
Get All Agents
curl --request GET \
--url https://unpod.ai/api/v2/platform/agents/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/agents/"
headers = {
"Org-Handle": "<org-handle>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Org-Handle': '<org-handle>', Authorization: '<api-key>'}
};
fetch('https://unpod.ai/api/v2/platform/agents/', 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://unpod.ai/api/v2/platform/agents/",
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>",
"Org-Handle: <org-handle>"
],
]);
$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://unpod.ai/api/v2/platform/agents/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Org-Handle", "<org-handle>")
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://unpod.ai/api/v2/platform/agents/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/agents/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Org-Handle"] = '<org-handle>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 94,
"status_code": 200,
"message": "Agents fetched successfully",
"data": [
{
"handle": "space-agent-8qmk42nslp91wrh3dz7btxc4",
"name": "General Agentic",
"type": "Voice",
"state": "published",
"purpose": "Handle outbound sales calls"
}
]
}
{
"status_code": 401,
"message": "Authentication credentials were not provided."
}