Create a campaign
POST/ads/{connection_id}/campaign
Parameters
fieldsstring array
Fields to return
rawstring
Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar
connection_idstring required
ID of the connection
Payload
idstring
created_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
updated_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
namestring
organization_idstring
effective_status enum
read-only; controlled by the provider (whether/why the campaign can serve), unlike the user-managed status
start_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
end_atdate-time
(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
budget_amountnumber
budget_period enum
Valid values:
"DAILY"
"MONTHLY"
"TOTAL"
"LIFETIME"
budget_unit enum
Valid values:
"UNSPECIFIED"
"CURRENCY"
"IMPRESSIONS"
total_spend_amountnumber
planned_spend_amountnumber
campaign_budget_identifierstring
Resource name for existing/shared budget (Google)
currencystring
categorystring
Housing, employment, credit, NONE (Meta)
has_eu_political_adsboolean
labelsstring array
Returns
| Response field | Type | Required | Description |
|---|---|---|---|
id | string | No | |
created_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
updated_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
name | string | No | |
organization_id | string | No | |
status | enum | No | Values: UNSPECIFIED, ACTIVE, PAUSED, ARCHIVED, DRAFT, SCHEDULED_FOR_DELETION, PROCESSING, PROCESSING_FAILED |
effective_status | enum | No | read-only; controlled by the provider (whether/why the campaign can serve), unlike the user-managed status Values: UNSPECIFIED, SERVING, LIMITED, LEARNING, PAUSED, PENDING, ENDED, MISCONFIGURED, NOT_ELIGIBLE, ARCHIVED, REMOVED |
start_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
end_at | string (date-time) | No | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
budget_amount | number | No | |
budget_period | enum | No | Values: DAILY, MONTHLY, TOTAL, LIFETIME |
budget_unit | enum | No | Values: UNSPECIFIED, CURRENCY, IMPRESSIONS |
total_spend_amount | number | No | |
targeting | object | No | |
targeting.geographic | AdsCampaign_targeting_geographic | No | |
targeting.geographic.countries | TargetRef[] | No | |
targeting.geographic.countries[].id | string | No | |
targeting.geographic.countries[].name | string | No | |
targeting.geographic.regions | TargetRef[] | No | |
targeting.geographic.regions[].id | string | No | |
targeting.geographic.regions[].name | string | No | |
targeting.geographic.cities | CityTarget[] | No | |
targeting.geographic.cities[].id | string | Yes | |
targeting.geographic.cities[].name | string | No | |
targeting.geographic.cities[].radius | number | No | |
targeting.geographic.cities[].radius_unit | enum | No | Values: MILES, KILOMETERS |
targeting.geographic.postal_codes | TargetRef[] | No | |
targeting.geographic.postal_codes[].id | string | No | |
targeting.geographic.postal_codes[].name | string | No | |
targeting.geographic.us_dmas | TargetRef[] | No | |
targeting.geographic.us_dmas[].id | string | No | |
targeting.geographic.us_dmas[].name | string | No | |
targeting.geographic.excluded_countries | TargetRef[] | No | |
targeting.geographic.excluded_countries[].id | string | No | |
targeting.geographic.excluded_countries[].name | string | No | |
targeting.geographic.excluded_regions | TargetRef[] | No | |
targeting.geographic.excluded_regions[].id | string | No | |
targeting.geographic.excluded_regions[].name | string | No | |
targeting.geographic.excluded_cities | CityTarget[] | No | |
targeting.geographic.excluded_cities[].id | string | Yes | |
targeting.geographic.excluded_cities[].name | string | No | |
targeting.geographic.excluded_cities[].radius | number | No | |
targeting.geographic.excluded_cities[].radius_unit | enum | No | Values: MILES, KILOMETERS |
targeting.geographic.excluded_postal_codes | TargetRef[] | No | |
targeting.geographic.excluded_postal_codes[].id | string | No | |
targeting.geographic.excluded_postal_codes[].name | string | No | |
targeting.geographic.excluded_us_dmas | TargetRef[] | No | |
targeting.geographic.excluded_us_dmas[].id | string | No | |
targeting.geographic.excluded_us_dmas[].name | string | No | |
targeting.geographic.location_types | enum[] | No | Values: HOME, RECENT, TRAVEL |
targeting.geographic.presence_type | enum | No | Values: PRESENCE, PRESENCE_OR_INTEREST |
targeting.demographic | AdsCampaign_targeting_demographic | No | Demographic targeting (Meta: age_min, age_max, genders) |
targeting.demographic.age_min | number | No | |
targeting.demographic.age_max | number | No | |
targeting.demographic.male | boolean | No | |
targeting.demographic.female | boolean | No | |
targeting.audience | AdsCampaign_targeting_audience | No | |
targeting.audience.custom_audiences | TargetRef[] | No | |
targeting.audience.custom_audiences[].id | string | No | |
targeting.audience.custom_audiences[].name | string | No | |
targeting.audience.excluded_custom_audiences | TargetRef[] | No | |
targeting.audience.excluded_custom_audiences[].id | string | No | |
targeting.audience.excluded_custom_audiences[].name | string | No | |
targeting.audience.lookalike_audiences | LookalikeAudience[] | No | |
targeting.audience.lookalike_audiences[].id | string | Yes | |
targeting.audience.lookalike_audiences[].name | string | No | |
targeting.audience.lookalike_audiences[].similarity | number | No | |
targeting.audience.lookalike_audiences[].source_audience_id | string | No | |
targeting.audience.interests | TargetRef[] | No | |
targeting.audience.interests[].id | string | No | |
targeting.audience.interests[].name | string | No | |
targeting.audience.excluded_interests | TargetRef[] | No | |
targeting.audience.excluded_interests[].id | string | No | |
targeting.audience.excluded_interests[].name | string | No | |
targeting.audience.behaviors | TargetRef[] | No | |
targeting.audience.behaviors[].id | string | No | |
targeting.audience.behaviors[].name | string | No | |
targeting.audience.excluded_behaviors | TargetRef[] | No | |
targeting.audience.excluded_behaviors[].id | string | No | |
targeting.audience.excluded_behaviors[].name | string | No | |
targeting.audience.combination_spec | AudienceCombination[] | No | |
targeting.audience.combination_spec[].interests | TargetRef[] | No | |
targeting.audience.combination_spec[].interests[].id | string | No | |
targeting.audience.combination_spec[].interests[].name | string | No | |
targeting.audience.combination_spec[].behaviors | TargetRef[] | No | |
targeting.audience.combination_spec[].behaviors[].id | string | No | |
targeting.audience.combination_spec[].behaviors[].name | string | No | |
targeting.audience.combination_spec[].references | TargetRef[] | No | |
targeting.audience.combination_spec[].references[].id | string | No | |
targeting.audience.combination_spec[].references[].name | string | No | |
targeting.audience.combination_spec[].life_events | TargetRef[] | No | |
targeting.audience.combination_spec[].life_events[].id | string | No | |
targeting.audience.combination_spec[].life_events[].name | string | No | |
targeting.placement | AdsCampaign_targeting_placement | No | |
targeting.placement.platforms | string[] | No | |
targeting.placement.facebook_positions | string[] | No | |
targeting.placement.instagram_positions | string[] | No | |
targeting.placement.messenger_positions | string[] | No | |
targeting.placement.audience_network_positions | string[] | No | |
targeting.device | AdsCampaign_targeting_device | No | |
targeting.device.types | TargetRef[] | No | |
targeting.device.types[].id | string | No | |
targeting.device.types[].name | string | No | |
targeting.device.user_device | TargetRef[] | No | |
targeting.device.user_device[].id | string | No | |
targeting.device.user_device[].name | string | No | |
targeting.device.user_os | TargetRef[] | No | |
targeting.device.user_os[].id | string | No | |
targeting.device.user_os[].name | string | No | |
targeting.device.carriers | TargetRef[] | No | |
targeting.device.carriers[].id | string | No | |
targeting.device.carriers[].name | string | No | |
targeting.language | TargetRef[] | No | |
targeting.language[].id | string | No | |
targeting.language[].name | string | No | |
targeting.content | AdsCampaign_targeting_content | No | |
targeting.content.keywords | AdsKeyword[] | No | |
targeting.content.keywords[].text | string | Yes | |
targeting.content.keywords[].match_type | enum | No | Values: BROAD, PHRASE, EXACT |
targeting.content.excluded_keywords | AdsKeyword[] | No | |
targeting.content.excluded_keywords[].text | string | Yes | |
targeting.content.excluded_keywords[].match_type | enum | No | Values: BROAD, PHRASE, EXACT |
targeting.content.topics | TargetRef[] | No | |
targeting.content.topics[].id | string | No | |
targeting.content.topics[].name | string | No | |
targeting.content.excluded_topics | TargetRef[] | No | |
targeting.content.excluded_topics[].id | string | No | |
targeting.content.excluded_topics[].name | string | No | |
targeting.content.urls | string[] | No | |
targeting.content.excluded_urls | string[] | No | |
targeting.content.video | AdsCampaign_targeting_content_video | No | |
targeting.content.video.youtube_videos | string[] | No | |
targeting.content.video.excluded_youtube_videos | string[] | No | |
targeting.content.video.youtube_channels | string[] | No | |
targeting.content.video.excluded_youtube_channels | string[] | No | |
targeting.content.video.positions | enum[] | No | Values: PREROLL, MIDROLL, POSTROLL, INSTREAM, OUTSTREAM |
targeting.content.video.player_sizes | enum[] | No | Values: SMALL, LARGE, HD |
targeting.content.video.durations | enum[] | No | Values: SHORT, MEDIUM, LONG |
targeting.brand_safety | AdsCampaign_targeting_brand_safety | No | Brand safety (Meta: excluded_publisher_categories, etc.; Google |
targeting.brand_safety.excluded_publisher_categories | string[] | No | |
targeting.brand_safety.excluded_content_labels | string[] | No | Google Ads ContentLabelType |
targeting.brand_safety.brand_safety_content_filter_levels | string[] | No | |
targeting.brand_safety.publisher_visibility_categories | enum[] | No | Values: limited, standard, expanded |
targeting.brand_safety.block_list_ids | string[] | No | |
targeting.schedule | AdSchedule[] | No | |
targeting.schedule[].day_of_week | enum | Yes | Values: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY |
targeting.schedule[].start_hour | number | Yes | 0-23 |
targeting.schedule[].start_minute | number | No | 0, 15, 30, 45 |
targeting.schedule[].end_hour | number | Yes | 0-24 (24 = end of day) |
targeting.schedule[].end_minute | number | No | 0, 15, 30, 45 |
targeting.schedule[].bid_modifier | number | No | 0.1-10.0 |
targeting.optimization | AdsCampaign_targeting_optimization | No | Optimization (Meta: targeting_automation; Google: observation vs targeting mode) |
targeting.optimization.mode | enum | No | Google: bid_only falsetrue Values: TARGETING, OBSERVATION |
targeting.optimization.advantage_audience | boolean | No | |
targeting.optimization.advantage_placements | boolean | No | |
targeting.optimization.targeting_optimization_expansion_all | boolean | No | |
goal | enum | No | Values: UNSPECIFIED, BRAND_AWARENESS, ENGAGEMENT, REACH, WEBSITE_TRAFFIC, LEADS, SALES, APP_PROMOTION |
planned_spend_amount | number | No | |
frequency_cap | object | No | |
frequency_cap.is_unlimited | boolean | No | |
frequency_cap.time_unit | enum | No | Values: UNSPECIFIED, LIFETIME, MONTHS, WEEKS, DAYS, HOURS, MINUTES |
frequency_cap.time_unit_count | number | No | |
frequency_cap.max_impressions | number | No | |
frequency_cap.max_views | number | No | |
advertising_channel_type | enum | No | Values: TEXT, IMAGE, VIDEO, RESPONSIVE, SHOPPING, APP, CALL, CAROUSEL, SOCIAL, DISPLAY, SEARCH, AUDIO, YOUTUBE, NATIVE, CTV, DOOH, PERFORMANCE_MAX |
campaign_budget_identifier | string | No | Resource name for existing/shared budget (Google) |
currency | string | No | |
category | string | No | Housing, employment, credit, NONE (Meta) |
has_eu_political_ads | boolean | No | |
labels | string[] | No | |
kpi | object | No | |
kpi.type | enum | No | Values: UNSPECIFIED, CPM, CPC, CPA, CTR, VIEWABILITY, CPIAVC, CPE, CPV, CLICK_CVR, IMPRESSION_CVR, VCPM, VTR, AUDIO_COMPLETION_RATE, VIDEO_COMPLETION_RATE, CPCL, CPCV, TOS10, MAXIMIZE_PACING, CUSTOM_IMPRESSION_VALUE_OVER_COST, OTHER |
kpi.amount | number | No | |
kpi.percentage | number | No | |
kpi.string_value | string | No | |
kpi.algorithm_id | string | No |
Errors
Errors return the HTTP status code and a JSON body with statusCode, error (the short label) and message (a human-readable detail).
{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Too many requests to unified.to API; max requests per minute: N"
}| Status | Error | Meaning |
|---|---|---|
400 | Bad Request | The request was malformed or failed validation. |
401 | Unauthorized | The connection is likely broken; re-authorize it. |
403 | Forbidden | The connection is missing permissions or scopes. |
404 | Not Found | The requested resource does not exist. |
429 | Too Many Requests | Rate limit exceeded (see the two sources below). |
500 | Internal Server Error | An unexpected error occurred. |
501 | Not Implemented | Not supported by this integration. |
Errors from the underlying integration pass through: the integration's status comes back as ours (429, 401, 403, 404 or 5xx), usually with its message. When the integration's error body is unclear, Unified extracts what it can and returns a clearer message.
429 Too Many Requests
A 429 has two possible sources:
- The integration's own rate limit, passed through.
- Unified's workspace limit: a rolling 60 seconds, set by plan, with the message
Too many requests to unified.to API; max requests per minute: N.
const options = {
method: 'POST',
url: 'https://api.unified.to/ads/5de520f96e439b002043d8dc/campaign',
headers: {
authorization: 'bearer .....'
},
data: undefined,
params: {
fields: '',
raw: '',
}
};
const results = await axios.request(options); Are we missing anything? Let us know