Get campaign statistics
curl --request GET \
--url https://api.example.com/v1/campaigns/:id/statsimport requests
url = "https://api.example.com/v1/campaigns/:id/stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/campaigns/:id/stats', 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/v1/campaigns/:id/stats",
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/v1/campaigns/:id/stats"
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/v1/campaigns/:id/stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/campaigns/:id/stats")
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_bodyCampaign
Get campaign statistics
Returns aggregated statistics for a campaign, including call volumes, connection & conversion rates, a full dispositions breakdown, and a per-agent performance report.
GET
/
v1
/
campaigns
/
:id
/
stats
Get campaign statistics
curl --request GET \
--url https://api.example.com/v1/campaigns/:id/statsimport requests
url = "https://api.example.com/v1/campaigns/:id/stats"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/campaigns/:id/stats', 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/v1/campaigns/:id/stats",
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/v1/campaigns/:id/stats"
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/v1/campaigns/:id/stats")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/campaigns/:id/stats")
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_bodyRequest
GET /v1/campaigns/:id/stats
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | uuid | Yes | The campaign ID |
Example
curl -X GET \
https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/campaigns/c1d2e3f4-.../stats \
-H "Authorization: Bearer rchd_live_xxxxxxxxxxxx"
const campaignId = 'c1d2e3f4-...';
const response = await fetch(
`https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/campaigns/${campaignId}/stats`,
{
headers: {
'Authorization': 'Bearer rchd_live_xxxxxxxxxxxx'
}
}
);
const { data } = await response.json();
import requests
campaign_id = 'c1d2e3f4-...'
response = requests.get(
f'https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/campaigns/{campaign_id}/stats',
headers={'Authorization': 'Bearer rchd_live_xxxxxxxxxxxx'}
)
data = response.json()['data']
Response
Top-level fields
| Field | Type | Description |
|---|---|---|
total_leads | integer | Total leads enrolled in the campaign |
called_leads | integer | Leads that have been called at least once |
total_calls | integer | Total outbound call attempts |
answered_calls | integer | Calls answered by a person (excludes voicemail) |
conversations | integer | Calls classified as conversations (≥ 60 s) |
total_talk_time_seconds | integer | Total talk time in seconds for all calls |
appointments | integer | Leads with an appointment-scheduled outcome |
connection_rate | float | answered_calls / total_calls × 100 (%) |
conversion_rate | float | appointments / conversations × 100 (%) |
dispositions | array | Breakdown of call outcomes — see below |
agents | array | Per-agent performance — see below |
dispositions array
| Field | Type | Description |
|---|---|---|
disposition | string | The outcome label (e.g. no-answer, appointment-scheduled) |
count | integer | Number of outbound calls with that outcome |
agents array
| Field | Type | Description |
|---|---|---|
agent_id | uuid | User ID of the agent |
first_name | string | Agent first name |
last_name | string | Agent last name |
email | string | Agent email address |
total_calls | integer | Total calls made by this agent in the campaign |
answered_calls | integer | Answered calls (non-voicemail) |
conversations | integer | Conversations (≥ 60 s) |
total_talk_time_seconds | integer | Cumulative talk time in seconds |
appointments | integer | Appointments booked by this agent |
Example response
{
"data": {
"total_leads": 350,
"called_leads": 280,
"total_calls": 412,
"answered_calls": 198,
"conversations": 87,
"total_talk_time_seconds": 18540,
"appointments": 14,
"connection_rate": 48.1,
"conversion_rate": 16.1,
"dispositions": [
{ "disposition": "no-answer", "count": 214 },
{ "disposition": "conversation", "count": 87 },
{ "disposition": "voicemail-left", "count": 62 },
{ "disposition": "not-interested", "count": 35 },
{ "disposition": "appointment-scheduled", "count": 14 }
],
"agents": [
{
"agent_id": "u1a2b3c4-...",
"first_name": "Sophie",
"last_name": "Bernard",
"email": "sophie@company.com",
"total_calls": 210,
"answered_calls": 105,
"conversations": 48,
"total_talk_time_seconds": 9800,
"appointments": 8
},
{
"agent_id": "u9x8y7z6-...",
"first_name": "Thomas",
"last_name": "Petit",
"email": "thomas@company.com",
"total_calls": 202,
"answered_calls": 93,
"conversations": 39,
"total_talk_time_seconds": 8740,
"appointments": 6
}
]
}
}
Errors
| Status | Code | Description |
|---|---|---|
401 | unauthorized | Missing or invalid API key |
404 | not_found | Campaign not found or does not belong to your account |
500 | internal | Unexpected server error |
⌘I
.png?fit=max&auto=format&n=PYj-p9lRwfHX4QQS&q=85&s=967f00940a17d1d8cc11bd8995dc98d0)
.png?fit=max&auto=format&n=PYj-p9lRwfHX4QQS&q=85&s=5072033d90dfd5e7cc9349712ea4e145)