Spend API
Upsert one or multiple spend records
Create or update daily spend records. Records are matched on platform and the campaign/adset/ad hierarchy plus date; existing records with the same key are overwritten. Batches of up to 1000 per call.
POST
Upsert daily spend records
Headers
Body
| Field | Type | Description |
|---|---|---|
data required | object[] | |
Field Type Description Example date requiredstring (date) The date of spend entry to upsert, required ”1970-01-01”platform_account_idstring The Ad Platform Account ID to upsert, used for segregating ad objects per ad platform account Default: """12345”platform_name requiredstring The Ad Platform Name to upsert, required ”Facebook”campaign_id requiredstring The Ad Platform’s Campaign ID (utm_campaign, if known) to upsert, required ”12345”campaign_name requiredstring The Ad Platform Campaign Name to upsert - will be as Ad Name in the Northbeam Dashboard - can be the same as campaign_id”Banana Festival Awareness Campaign”adset_idstring The Ad Platform’s Adset ID (utm_term, if known) to upsert, defaults to ” if empty (not all platforms support adsets) Default: """12345”adset_namestring The Ad Platform Adset Name to upsert - will be as Ad Name in the Northbeam Dashboard - can be the same as adset_id - defaults to ” if emptyDefault: """Banana Adset”ad_idstring The Ad Platform’s Ad ID (utm_content, if known) to upsert, defaults to ” if empty (not all platforms support ads) Default: """12345”ad_namestring The Ad Platform Ad Name to upsert - will be as Ad Name in the Northbeam Dashboard - can be the same as adset_id - defaults to ” if emptyDefault: """Banana Ad”spend requirednumber Amount (in currency) spent on ad object to upsert, defaults to 0 if empty Required range: x >= 0”123”spend_currency requiredstring The Currency of the Spend per ISO 4217 to upsert, required Required string length: 3 - 3”USD”impressionsnumber The amount of impressions the ad object received on a given date, defaults to 0 if empty Required range: x >= 0Default: 0299clicksnumber The amount of clicks the ad object received on a given date, defaults to 0 if empty Required range: x >= 0Default: 00 |
Responses
201 response body
| Field | Type | Description |
|---|---|---|
data required | object[] | |
Field Type Description Example date requiredstring (date) The date of spend entry to upsert, required ”1970-01-01”platform_account_idstring The Ad Platform Account ID to upsert, used for segregating ad objects per ad platform account Default: """12345”platform_name requiredstring The Ad Platform Name to upsert, required ”Facebook”campaign_id requiredstring The Ad Platform’s Campaign ID (utm_campaign, if known) to upsert, required ”12345”campaign_name requiredstring The Ad Platform Campaign Name to upsert - will be as Ad Name in the Northbeam Dashboard - can be the same as campaign_id”Banana Festival Awareness Campaign”adset_idstring The Ad Platform’s Adset ID (utm_term, if known) to upsert, defaults to ” if empty (not all platforms support adsets) Default: """12345”adset_namestring The Ad Platform Adset Name to upsert - will be as Ad Name in the Northbeam Dashboard - can be the same as adset_id - defaults to ” if emptyDefault: """Banana Adset”ad_idstring The Ad Platform’s Ad ID (utm_content, if known) to upsert, defaults to ” if empty (not all platforms support ads) Default: """12345”ad_namestring The Ad Platform Ad Name to upsert - will be as Ad Name in the Northbeam Dashboard - can be the same as adset_id - defaults to ” if emptyDefault: """Banana Ad”spend requirednumber Amount (in currency) spent on ad object to upsert, defaults to 0 if empty Required range: x >= 0”123”spend_currency requiredstring The Currency of the Spend per ISO 4217 to upsert, required Required string length: 3 - 3”USD”impressionsnumber The amount of impressions the ad object received on a given date, defaults to 0 if empty Required range: x >= 0Default: 0299clicksnumber The amount of clicks the ad object received on a given date, defaults to 0 if empty Required range: x >= 0Default: 00created_at requiredstring (date-time) updated_at requiredstring (date-time) |
401 response body
| Field | Type | Description |
|---|---|---|
errors | object[], nullable | |
message required | string | |
request_id | string (uuid), nullable |
422 response body
| Field | Type | Description |
|---|---|---|
errors | object[], nullable | |
message required | string | |
request_id | string (uuid), nullable |
4XX response body
| Field | Type | Description |
|---|---|---|
errors | object[], nullable | |
message required | string | |
request_id | string (uuid), nullable |
5XX response body
| Field | Type | Description |
|---|---|---|
errors | object[], nullable | |
message required | string | |
request_id | string (uuid), nullable |