Spend API
Upsert one or multiple hourly spend records
Create or update hourly spend records. Same matching behavior as the daily endpoint, at hourly granularity. Batches of up to 1000 per call.
POST
Upsert hourly spend records
Headers
Body
| Field | Type | Description |
|---|---|---|
data required | object[] | |
Field Type Description Example hour_start_iso requiredstring (date-time) The date-time of spend entry to upsert in UTC, required ”1970-01-01T00:00:00-0000”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 >= 0123.5spend_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 hour_start_iso requiredstring (date-time) The date-time of spend entry to upsert in UTC, required ”1970-01-01T00:00:00-0000”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 >= 0123.5spend_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 |