Get Usage by Initiator
curl --request GET \
--url https://api.politicalcomms.com/v1/ledger/usage/by-initiator \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.politicalcomms.com/v1/ledger/usage/by-initiator"
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/by-initiator', 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/by-initiator",
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/by-initiator"
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/by-initiator")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.politicalcomms.com/v1/ledger/usage/by-initiator")
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",
"initiators": [
{
"initiatingOrganizationId": "9e4c7b2a-5f18-4d3e-a6b9-1c8f4e7a2d55",
"initiatingOrganizationName": "Regional Office East",
"usage": [
{
"date": "2025-07-02T00:00:00.000Z",
"productCode": "sms_outbound",
"eventType": "charge_success",
"quantity": 4200,
"totalAmount": -126,
"transactionCount": 4200
}
],
"totalAmount": -126,
"totalQuantity": 4200,
"transactionCount": 4200
}
],
"totalAmount": -126,
"totalQuantity": 4200,
"totalTransactionCount": 4200
}
}Billing
Get Usage by Initiator
Ledger usage grouped by the organization that initiated each charge, for a date range (max 31 days, no older than 180 days). Amounts are signed: charges are negative. Initiators are sorted by totalAmount descending.
GET
/
ledger
/
usage
/
by-initiator
Get Usage by Initiator
curl --request GET \
--url https://api.politicalcomms.com/v1/ledger/usage/by-initiator \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.politicalcomms.com/v1/ledger/usage/by-initiator"
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/by-initiator', 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/by-initiator",
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/by-initiator"
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/by-initiator")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.politicalcomms.com/v1/ledger/usage/by-initiator")
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",
"initiators": [
{
"initiatingOrganizationId": "9e4c7b2a-5f18-4d3e-a6b9-1c8f4e7a2d55",
"initiatingOrganizationName": "Regional Office East",
"usage": [
{
"date": "2025-07-02T00:00:00.000Z",
"productCode": "sms_outbound",
"eventType": "charge_success",
"quantity": 4200,
"totalAmount": -126,
"transactionCount": 4200
}
],
"totalAmount": -126,
"totalQuantity": 4200,
"transactionCount": 4200
}
],
"totalAmount": -126,
"totalQuantity": 4200,
"totalTransactionCount": 4200
}
}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
⌘I
