Get Summary Analytics
curl --request GET \
--url https://api.example.com/api/analytics/summaryimport requests
url = "https://api.example.com/api/analytics/summary"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/analytics/summary', 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/summary",
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/summary"
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/summary")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/analytics/summary")
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": {},
"calls": {
"total": 123,
"completed": 123,
"failed": 123,
"avg_duration_seconds": 123
},
"spend": {
"total_credits": 123,
"total_usd": 123,
"by_component": {}
},
"credits": {
"added": 123,
"used": 123
}
}
}Analytics
Get Summary Analytics
Retrieve high-level totals for calls, spend, and credits.
GET
/
api
/
analytics
/
summary
Get Summary Analytics
curl --request GET \
--url https://api.example.com/api/analytics/summaryimport requests
url = "https://api.example.com/api/analytics/summary"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/analytics/summary', 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/summary",
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/summary"
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/summary")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/analytics/summary")
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": {},
"calls": {
"total": 123,
"completed": 123,
"failed": 123,
"avg_duration_seconds": 123
},
"spend": {
"total_credits": 123,
"total_usd": 123,
"by_component": {}
},
"credits": {
"added": 123,
"used": 123
}
}
}Fetches aggregated totals across your entire account for a given time period. You can optionally filter the results to a specific agent.
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 and changes data granularity to minutes.string
End exact time in ISO 8601 format. Overrides
end_date.string
Filter the summary to only include data for a specific agent.
Response
boolean
Indicates whether the request was successful.
object
Show properties
Show properties
object
The actual time period used for the query, containing
start and end strings.object
object