Get Message Stats
curl --request GET \
--url https://api.politicalcomms.com/v1/messages/stats \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.politicalcomms.com/v1/messages/stats"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.politicalcomms.com/v1/messages/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.politicalcomms.com/v1/messages/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.politicalcomms.com/v1/messages/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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://api.politicalcomms.com/v1/messages/stats")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.politicalcomms.com/v1/messages/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"totals": {
"delivered": {
"count": 11342,
"totalCost": 340.26
},
"failed": {
"count": 458,
"totalCost": 13.74
},
"received": {
"count": 312,
"totalCost": 0
}
},
"summary": {
"totalMessages": 12112,
"statusBreakdown": {
"unsent": 0,
"queued": 0,
"sending": 0,
"sent": 0,
"delivered": 11342,
"failed": 458,
"received": 312,
"onHold": 0
},
"totalCost": 354,
"projectCount": 1,
"organizationCount": 1
},
"deliveryRates": {
"totalMessages": 12112,
"deliveredCount": 11342,
"failedCount": 458,
"successfulCount": 11800,
"deliveryRate": 93.64,
"failureRate": 3.78,
"successRate": 97.42
},
"byDay": [
{
"date": "2025-07-02T00:00:00.000Z",
"status": "delivered",
"count": 11342,
"totalCost": 340.26
},
{
"date": "2025-07-02T00:00:00.000Z",
"status": "failed",
"count": 458,
"totalCost": 13.74
}
],
"dateRange": {
"startDate": "2025-07-01",
"endDate": "2025-07-31"
}
}
}Analytics
Get Message Stats
Message delivery statistics for a date range. The range must be 31 days or less and may not start more than 180 days in the past or end in the future.
GET
/
messages
/
stats
Get Message Stats
curl --request GET \
--url https://api.politicalcomms.com/v1/messages/stats \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.politicalcomms.com/v1/messages/stats"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.politicalcomms.com/v1/messages/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.politicalcomms.com/v1/messages/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.politicalcomms.com/v1/messages/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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://api.politicalcomms.com/v1/messages/stats")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.politicalcomms.com/v1/messages/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"totals": {
"delivered": {
"count": 11342,
"totalCost": 340.26
},
"failed": {
"count": 458,
"totalCost": 13.74
},
"received": {
"count": 312,
"totalCost": 0
}
},
"summary": {
"totalMessages": 12112,
"statusBreakdown": {
"unsent": 0,
"queued": 0,
"sending": 0,
"sent": 0,
"delivered": 11342,
"failed": 458,
"received": 312,
"onHold": 0
},
"totalCost": 354,
"projectCount": 1,
"organizationCount": 1
},
"deliveryRates": {
"totalMessages": 12112,
"deliveredCount": 11342,
"failedCount": 458,
"successfulCount": 11800,
"deliveryRate": 93.64,
"failureRate": 3.78,
"successRate": 97.42
},
"byDay": [
{
"date": "2025-07-02T00:00:00.000Z",
"status": "delivered",
"count": 11342,
"totalCost": 340.26
},
{
"date": "2025-07-02T00:00:00.000Z",
"status": "failed",
"count": 458,
"totalCost": 13.74
}
],
"dateRange": {
"startDate": "2025-07-01",
"endDate": "2025-07-31"
}
}
}Authorizations
Authenticate every request by passing your API key in the X-API-Key header. Keys are scoped to your organization hierarchy.
Query Parameters
Start date in YYYY-MM-DD format
Example:
"2026-01-01"
End date in YYYY-MM-DD format
Example:
"2026-01-31"
Filter to a specific descendant organization
Filter to a specific brand
Filter to a specific campaign
⌘I
