Get Usage
curl --request GET \
--url https://api.politicalcomms.com/v1/ledger/usage \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.politicalcomms.com/v1/ledger/usage"
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/ledger/usage', 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/ledger/usage",
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/ledger/usage"
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/ledger/usage")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.politicalcomms.com/v1/ledger/usage")
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": {
"startDate": "2025-07-01",
"endDate": "2025-07-31",
"organizations": [
{
"organizationId": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10",
"organizationName": "Smith Campaign 2024",
"stripeCustomerId": "cus_QWERty123456",
"accountRep": null,
"tier": 1,
"usage": [
{
"productCode": "sms_outbound",
"eventType": "charge_success",
"quantity": 11800,
"unitPrice": 0.03,
"totalAmount": -354,
"transactionCount": 11800
}
],
"payments": [],
"adjustments": [],
"totalUsageAmount": -354,
"totalPaymentAmount": 0
}
],
"totalUsageAmount": -354,
"totalPaymentAmount": 0,
"totalQuantity": 11800,
"serviceTotals": {
"sms_outbound": 11800
}
}
}Billing
Get Usage
Ledger usage aggregated per organization 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. Charge amounts are signed: usage charges are negative.
GET
/
ledger
/
usage
Get Usage
curl --request GET \
--url https://api.politicalcomms.com/v1/ledger/usage \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.politicalcomms.com/v1/ledger/usage"
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/ledger/usage', 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/ledger/usage",
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/ledger/usage"
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/ledger/usage")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.politicalcomms.com/v1/ledger/usage")
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": {
"startDate": "2025-07-01",
"endDate": "2025-07-31",
"organizations": [
{
"organizationId": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10",
"organizationName": "Smith Campaign 2024",
"stripeCustomerId": "cus_QWERty123456",
"accountRep": null,
"tier": 1,
"usage": [
{
"productCode": "sms_outbound",
"eventType": "charge_success",
"quantity": 11800,
"unitPrice": 0.03,
"totalAmount": -354,
"transactionCount": 11800
}
],
"payments": [],
"adjustments": [],
"totalUsageAmount": -354,
"totalPaymentAmount": 0
}
],
"totalUsageAmount": -354,
"totalPaymentAmount": 0,
"totalQuantity": 11800,
"serviceTotals": {
"sms_outbound": 11800
}
}
}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
