Get Hierarchy
curl --request GET \
--url https://api.politicalcomms.com/v1/hierarchy \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.politicalcomms.com/v1/hierarchy"
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/hierarchy', 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/hierarchy",
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/hierarchy"
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/hierarchy")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.politicalcomms.com/v1/hierarchy")
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": {
"id": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10",
"name": "Smith Campaign 2024",
"parentId": null,
"status": "active",
"contactEmail": "ops@smithcampaign.com",
"contactFirstName": "Jordan",
"contactLastName": "Smith",
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-06-01T09:30:00.000Z",
"brands": [
{
"id": "7c1de5f0-9a42-4b6d-8e33-2f5a9c7b1e64",
"name": "Smith PAC",
"status": "OK",
"organizationId": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10",
"createdAt": "2024-01-15T11:00:00.000Z",
"updatedAt": "2024-01-20T08:00:00.000Z",
"campaigns": [
{
"id": "4b8fa3c1-6d25-4e9a-bf47-8c2e5d9a3f71",
"name": "Fall 2025 GOTV",
"status": "ACTIVE",
"createdAt": "2024-02-01T12:00:00.000Z",
"updatedAt": "2024-02-01T12:00:00.000Z"
}
]
}
],
"childOrganizations": [
{
"id": "9e4c7b2a-5f18-4d3e-a6b9-1c8f4e7a2d55",
"name": "Regional Office East",
"parentId": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10",
"status": "active",
"contactEmail": null,
"contactFirstName": null,
"contactLastName": null,
"createdAt": "2024-02-01T10:00:00.000Z",
"updatedAt": "2024-02-01T10:00:00.000Z",
"brands": [],
"childOrganizations": []
}
]
}
}Organizations
Get Hierarchy
Get the full organization hierarchy with brands and campaigns, rooted at the requested organization (defaults to the API key’s organization). Responses use camelCase field names and are cached for up to 5 minutes.
GET
/
hierarchy
Get Hierarchy
curl --request GET \
--url https://api.politicalcomms.com/v1/hierarchy \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.politicalcomms.com/v1/hierarchy"
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/hierarchy', 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/hierarchy",
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/hierarchy"
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/hierarchy")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.politicalcomms.com/v1/hierarchy")
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": {
"id": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10",
"name": "Smith Campaign 2024",
"parentId": null,
"status": "active",
"contactEmail": "ops@smithcampaign.com",
"contactFirstName": "Jordan",
"contactLastName": "Smith",
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-06-01T09:30:00.000Z",
"brands": [
{
"id": "7c1de5f0-9a42-4b6d-8e33-2f5a9c7b1e64",
"name": "Smith PAC",
"status": "OK",
"organizationId": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10",
"createdAt": "2024-01-15T11:00:00.000Z",
"updatedAt": "2024-01-20T08:00:00.000Z",
"campaigns": [
{
"id": "4b8fa3c1-6d25-4e9a-bf47-8c2e5d9a3f71",
"name": "Fall 2025 GOTV",
"status": "ACTIVE",
"createdAt": "2024-02-01T12:00:00.000Z",
"updatedAt": "2024-02-01T12:00:00.000Z"
}
]
}
],
"childOrganizations": [
{
"id": "9e4c7b2a-5f18-4d3e-a6b9-1c8f4e7a2d55",
"name": "Regional Office East",
"parentId": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10",
"status": "active",
"contactEmail": null,
"contactFirstName": null,
"contactLastName": null,
"createdAt": "2024-02-01T10:00:00.000Z",
"updatedAt": "2024-02-01T10:00:00.000Z",
"brands": [],
"childOrganizations": []
}
]
}
}Authorizations
Authenticate every request by passing your API key in the X-API-Key header. Keys are scoped to your organization hierarchy.
Query Parameters
Filter to a specific descendant organization
⌘I
