Agency Overview Stats
curl --request GET \
--url https://app.tuco.ai/api/agency/overview \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.tuco.ai/api/agency/overview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.tuco.ai/api/agency/overview', 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://app.tuco.ai/api/agency/overview",
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: Bearer <token>"
],
]);
$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://app.tuco.ai/api/agency/overview"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.tuco.ai/api/agency/overview")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/agency/overview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyAgency
Agency Overview Stats
Rolled-up messaging stats across every workspace in your Tuco agency, plus a per-workspace breakdown and billing health.
GET
/
api
/
agency
/
overview
Agency Overview Stats
curl --request GET \
--url https://app.tuco.ai/api/agency/overview \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.tuco.ai/api/agency/overview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.tuco.ai/api/agency/overview', 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://app.tuco.ai/api/agency/overview",
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: Bearer <token>"
],
]);
$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://app.tuco.ai/api/agency/overview"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.tuco.ai/api/agency/overview")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/agency/overview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyOne call for the whole agency: aggregate metrics, a row per workspace, line counts
and subscription health.
Endpoint
- Method:
GET - Path:
/api/agency/overview - Auth:
Authorization: Bearer tucoagency_xxxxxxxxxxxxx(agency key)
Query parameters
| Param | Type | Notes |
|---|---|---|
days | 7 | 30 | 90 | Window for the activity metrics. Omitted or invalid → all time. Line counts are current state and are never windowed |
Example request
curl "https://app.tuco.ai/api/agency/overview?days=30" \
-H "Authorization: Bearer tucoagency_xxxxxxxxxxxxx"
Success response (200)
{
"agencyId": "user_3H08IRicrVUYLDZRyOh4jKRVwrx",
"workspaces": 4,
"totalLines": 7,
"metrics": {
"reached": 1840,
"sent": 2190,
"fallback": 61,
"failed": 12,
"replied": 143,
"uniqueReplied": 128,
"repliedPct": 6.9,
"positiveReplied": 41,
"positivePct": 2.2
},
"statusCounts": { "active": 3, "attention": 1, "inactive": 0 },
"series": { "days": 30, "sent": [12, 40, 0, 31] },
"perWorkspace": [
{
"clerkOrgId": "org_3KKJKupHJ8Y9I2NXVAga0c6ZqgT",
"name": "Acme Roofing",
"legalName": "Acme Roofing LLC",
"plan": "starter",
"subscriptionStatus": "active",
"lines": 2,
"sent": 814,
"received": 57,
"failed": 3,
"repliedPct": 7.0
}
]
}
Reading it
metricsis the roll-up across every sub-workspace;perWorkspaceis the same computation per workspace, so the rows sum to the totals.statusCounts.attentioncounts workspaces inpast_due,unpaid,incomplete,incomplete_expiredorcanceled— the ones whose billing needs you.series.sentis a daily count for the lastdayscalendar days including today, for a sparkline.- An agency with no workspaces yet returns zeros, never another agency’s numbers.
Error responses
| Status | Code | When |
|---|---|---|
401 | UNAUTHORIZED | Missing, unknown, revoked or expired key |
403 | AGENCY_KEY_REQUIRED | A workspace key (tuco_…) was used |
403 | NOT_AN_AGENCY | The account behind the key is not an agency |