Skip to main content

Example API Usage

Here are examples of how to create a campaign using the Addressable.tv API in different programming languages:
import requests
import json

url = "https://api.addressable.tv/client/campaigns"
headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "name": "Summer 2025 Brand Campaign",
    "nickname": "SUM25",
    "advertiserName": "Acme Corporation",
    "clientCampaignId": "CAMP-2025-001",
    "networkExclusions": ["ESPN+", "Fox Sports"]
}

response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(data)

Request Schema

FieldTypeRequiredDescription
namestringYesCampaign name
nicknamestringNoShort campaign identifier
advertiserNamestringYesAdvertiser name (will fuzzy-match to existing or create new)
clientCampaignIdstringYesYour internal campaign identifier
networkExclusionsstring[]NoList of networks to exclude from activations

Response Schema

The API returns the created campaign object with additional system-generated fields.

Example Response

{
  "id": 1234,
  "name": "Summer 2025 Brand Campaign",
  "nickName": "SUM25",
  "status": "NEEDS_APPROVAL",
  "clientCampaignId": "CAMP-2025-001",
  "excludedNetworks": ["ESPN+", "Fox Sports"],
  "createdAt": "2025-01-15T10:30:00.000Z",
  "invalidNetworkExclusions": ["Fox Sports"]
}

Response Fields

FieldTypeDescription
idnumberThe unique campaign ID. Save this - you’ll need it when creating orders.
namestringCampaign name
nickNamestringShort campaign identifier
statusstringCampaign status (see status values below)
clientCampaignIdstringYour internal campaign identifier
excludedNetworksstring[]List of networks excluded from activations
createdAtstring (ISO 8601)Timestamp when the campaign was created
invalidNetworkExclusionsstring[]Networks in your exclusion list that don’t match known networks

Status Values

StatusDescription
NEEDS_APPROVALNewly created, awaiting review
PENDINGApproved, waiting to start
ACTIVECurrently running
PAUSEDTemporarily paused
COMPLETEFinished delivering
CANCELLEDCancelled before completion

Error Responses

Example Error Response

{
  "statusCode": 400,
  "message": ["name is required", "advertiserName is required"],
  "error": "Bad Request"
}

Common Errors

ErrorCause
name is requiredMissing required name field
advertiserName is requiredMissing required advertiserName field
clientCampaignId is requiredMissing required clientCampaignId field

Notes

  • Initial status is always NEEDS_APPROVAL - your account team will review and activate
  • Review invalidNetworkExclusions in the response to ensure your network exclusions are recognized
  • Save the returned id - you’ll need it when creating orders