Get Agent Analytics
curl --request GET \
--url https://api.example.com/api/analytics/agentsimport requests
url = "https://api.example.com/api/analytics/agents"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/analytics/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://api.example.com/api/analytics/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/analytics/agents"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/analytics/agents")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/analytics/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"period": {},
"agents": [
{
"agent_id": "<string>",
"agent_name": "<string>",
"total_calls": 123,
"total_cost_credits": 123,
"avg_duration_seconds": 123
}
]
}
}Analytics
Get Agent Analytics
View performance and cost metrics per agent.
GET
/
api
/
analytics
/
agents
Get Agent Analytics
curl --request GET \
--url https://api.example.com/api/analytics/agentsimport requests
url = "https://api.example.com/api/analytics/agents"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/analytics/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://api.example.com/api/analytics/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/analytics/agents"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/analytics/agents")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/analytics/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"period": {},
"agents": [
{
"agent_id": "<string>",
"agent_name": "<string>",
"total_calls": 123,
"total_cost_credits": 123,
"avg_duration_seconds": 123
}
]
}
}Provides a breakdown of call volume, costs, and average duration for individual agents over a specified period. This helps identify which agents handle the most traffic or consume the most credits.
Query Parameters
string
Start date in
YYYY-MM-DD format. Defaults to 30 days ago.string
End date in
YYYY-MM-DD format. Defaults to today.string
Start exact time in ISO 8601 format (e.g.
2024-03-01T14:30:00Z). Overrides start_date.string
End exact time in ISO 8601 format. Overrides
end_date.integer
default:"10"
Maximum number of agents to return. Values must be between
1 and 50.Response
boolean
Indicates whether the request was successful.
object
Show properties
Show properties
object
The start and end boundaries of the query.
array
List of agents and their associated metrics.
Show items
Show items
string
The unique identifier of the agent.
string
The display name of the agent. Returns “Unknown” if the agent has been deleted.
integer
Total number of calls processed by this agent during the period.
number
Platform credits consumed by this agent.
number
Average duration of calls in seconds for this agent.