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
status enum
Valid values:
"UNSPECIFIED"
"ACTIVE"
"PAUSED"
"ARCHIVED"
"DRAFT"
effective_status enum
Valid values:
"UNSPECIFIED"
"SERVING"
"LIMITED"
"LEARNING"
"PAUSED"
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
targetingobject
goal enum
Valid values:
"UNSPECIFIED"
"BRAND_AWARENESS"
"ENGAGEMENT"
"REACH"
"WEBSITE_TRAFFIC"
planned_spend_amountnumber
frequency_capobject
advertising_channel_type enum
Valid values:
"TEXT"
"IMAGE"
"VIDEO"
"RESPONSIVE"
"SHOPPING"
campaign_budget_identifierstring
Resource name for existing/shared budget (Google)
currencystring
categorystring
Housing, employment, credit, NONE (Meta)
has_eu_political_adsboolean
labelsstring array
kpiobject

Returns

Response fieldTypeRequiredDescription
idstringNo
created_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
updated_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
namestringNo
organization_idstringNo
statusenumNoValues: UNSPECIFIED, ACTIVE, PAUSED, ARCHIVED, DRAFT, SCHEDULED_FOR_DELETION, PROCESSING, PROCESSING_FAILED
effective_statusenumNoread-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_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
end_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
budget_amountnumberNo
budget_periodenumNoValues: DAILY, MONTHLY, TOTAL, LIFETIME
budget_unitenumNoValues: UNSPECIFIED, CURRENCY, IMPRESSIONS
total_spend_amountnumberNo
targetingobjectNo
targeting.geographicAdsCampaign_targeting_geographicNo
targeting.geographic.countriesTargetRef[]No
targeting.geographic.countries[].idstringNo
targeting.geographic.countries[].namestringNo
targeting.geographic.regionsTargetRef[]No
targeting.geographic.regions[].idstringNo
targeting.geographic.regions[].namestringNo
targeting.geographic.citiesCityTarget[]No
targeting.geographic.cities[].idstringYes
targeting.geographic.cities[].namestringNo
targeting.geographic.cities[].radiusnumberNo
targeting.geographic.cities[].radius_unitenumNoValues: MILES, KILOMETERS
targeting.geographic.postal_codesTargetRef[]No
targeting.geographic.postal_codes[].idstringNo
targeting.geographic.postal_codes[].namestringNo
targeting.geographic.us_dmasTargetRef[]No
targeting.geographic.us_dmas[].idstringNo
targeting.geographic.us_dmas[].namestringNo
targeting.geographic.excluded_countriesTargetRef[]No
targeting.geographic.excluded_countries[].idstringNo
targeting.geographic.excluded_countries[].namestringNo
targeting.geographic.excluded_regionsTargetRef[]No
targeting.geographic.excluded_regions[].idstringNo
targeting.geographic.excluded_regions[].namestringNo
targeting.geographic.excluded_citiesCityTarget[]No
targeting.geographic.excluded_cities[].idstringYes
targeting.geographic.excluded_cities[].namestringNo
targeting.geographic.excluded_cities[].radiusnumberNo
targeting.geographic.excluded_cities[].radius_unitenumNoValues: MILES, KILOMETERS
targeting.geographic.excluded_postal_codesTargetRef[]No
targeting.geographic.excluded_postal_codes[].idstringNo
targeting.geographic.excluded_postal_codes[].namestringNo
targeting.geographic.excluded_us_dmasTargetRef[]No
targeting.geographic.excluded_us_dmas[].idstringNo
targeting.geographic.excluded_us_dmas[].namestringNo
targeting.geographic.location_typesenum[]NoValues: HOME, RECENT, TRAVEL
targeting.geographic.presence_typeenumNoValues: PRESENCE, PRESENCE_OR_INTEREST
targeting.demographicAdsCampaign_targeting_demographicNoDemographic targeting (Meta: age_min, age_max, genders)
targeting.demographic.age_minnumberNo
targeting.demographic.age_maxnumberNo
targeting.demographic.malebooleanNo
targeting.demographic.femalebooleanNo
targeting.audienceAdsCampaign_targeting_audienceNo
targeting.audience.custom_audiencesTargetRef[]No
targeting.audience.custom_audiences[].idstringNo
targeting.audience.custom_audiences[].namestringNo
targeting.audience.excluded_custom_audiencesTargetRef[]No
targeting.audience.excluded_custom_audiences[].idstringNo
targeting.audience.excluded_custom_audiences[].namestringNo
targeting.audience.lookalike_audiencesLookalikeAudience[]No
targeting.audience.lookalike_audiences[].idstringYes
targeting.audience.lookalike_audiences[].namestringNo
targeting.audience.lookalike_audiences[].similaritynumberNo
targeting.audience.lookalike_audiences[].source_audience_idstringNo
targeting.audience.interestsTargetRef[]No
targeting.audience.interests[].idstringNo
targeting.audience.interests[].namestringNo
targeting.audience.excluded_interestsTargetRef[]No
targeting.audience.excluded_interests[].idstringNo
targeting.audience.excluded_interests[].namestringNo
targeting.audience.behaviorsTargetRef[]No
targeting.audience.behaviors[].idstringNo
targeting.audience.behaviors[].namestringNo
targeting.audience.excluded_behaviorsTargetRef[]No
targeting.audience.excluded_behaviors[].idstringNo
targeting.audience.excluded_behaviors[].namestringNo
targeting.audience.combination_specAudienceCombination[]No
targeting.audience.combination_spec[].interestsTargetRef[]No
targeting.audience.combination_spec[].interests[].idstringNo
targeting.audience.combination_spec[].interests[].namestringNo
targeting.audience.combination_spec[].behaviorsTargetRef[]No
targeting.audience.combination_spec[].behaviors[].idstringNo
targeting.audience.combination_spec[].behaviors[].namestringNo
targeting.audience.combination_spec[].referencesTargetRef[]No
targeting.audience.combination_spec[].references[].idstringNo
targeting.audience.combination_spec[].references[].namestringNo
targeting.audience.combination_spec[].life_eventsTargetRef[]No
targeting.audience.combination_spec[].life_events[].idstringNo
targeting.audience.combination_spec[].life_events[].namestringNo
targeting.placementAdsCampaign_targeting_placementNo
targeting.placement.platformsstring[]No
targeting.placement.facebook_positionsstring[]No
targeting.placement.instagram_positionsstring[]No
targeting.placement.messenger_positionsstring[]No
targeting.placement.audience_network_positionsstring[]No
targeting.deviceAdsCampaign_targeting_deviceNo
targeting.device.typesTargetRef[]No
targeting.device.types[].idstringNo
targeting.device.types[].namestringNo
targeting.device.user_deviceTargetRef[]No
targeting.device.user_device[].idstringNo
targeting.device.user_device[].namestringNo
targeting.device.user_osTargetRef[]No
targeting.device.user_os[].idstringNo
targeting.device.user_os[].namestringNo
targeting.device.carriersTargetRef[]No
targeting.device.carriers[].idstringNo
targeting.device.carriers[].namestringNo
targeting.languageTargetRef[]No
targeting.language[].idstringNo
targeting.language[].namestringNo
targeting.contentAdsCampaign_targeting_contentNo
targeting.content.keywordsAdsKeyword[]No
targeting.content.keywords[].textstringYes
targeting.content.keywords[].match_typeenumNoValues: BROAD, PHRASE, EXACT
targeting.content.excluded_keywordsAdsKeyword[]No
targeting.content.excluded_keywords[].textstringYes
targeting.content.excluded_keywords[].match_typeenumNoValues: BROAD, PHRASE, EXACT
targeting.content.topicsTargetRef[]No
targeting.content.topics[].idstringNo
targeting.content.topics[].namestringNo
targeting.content.excluded_topicsTargetRef[]No
targeting.content.excluded_topics[].idstringNo
targeting.content.excluded_topics[].namestringNo
targeting.content.urlsstring[]No
targeting.content.excluded_urlsstring[]No
targeting.content.videoAdsCampaign_targeting_content_videoNo
targeting.content.video.youtube_videosstring[]No
targeting.content.video.excluded_youtube_videosstring[]No
targeting.content.video.youtube_channelsstring[]No
targeting.content.video.excluded_youtube_channelsstring[]No
targeting.content.video.positionsenum[]NoValues: PREROLL, MIDROLL, POSTROLL, INSTREAM, OUTSTREAM
targeting.content.video.player_sizesenum[]NoValues: SMALL, LARGE, HD
targeting.content.video.durationsenum[]NoValues: SHORT, MEDIUM, LONG
targeting.brand_safetyAdsCampaign_targeting_brand_safetyNoBrand safety (Meta: excluded_publisher_categories, etc.; Google
targeting.brand_safety.excluded_publisher_categoriesstring[]No
targeting.brand_safety.excluded_content_labelsstring[]NoGoogle Ads ContentLabelType
targeting.brand_safety.brand_safety_content_filter_levelsstring[]No
targeting.brand_safety.publisher_visibility_categoriesenum[]NoValues: limited, standard, expanded
targeting.brand_safety.block_list_idsstring[]No
targeting.scheduleAdSchedule[]No
targeting.schedule[].day_of_weekenumYesValues: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
targeting.schedule[].start_hournumberYes0-23
targeting.schedule[].start_minutenumberNo0, 15, 30, 45
targeting.schedule[].end_hournumberYes0-24 (24 = end of day)
targeting.schedule[].end_minutenumberNo0, 15, 30, 45
targeting.schedule[].bid_modifiernumberNo0.1-10.0
targeting.optimizationAdsCampaign_targeting_optimizationNoOptimization (Meta: targeting_automation; Google: observation vs targeting mode)
targeting.optimization.modeenumNoGoogle: bid_only falsetrue Values: TARGETING, OBSERVATION
targeting.optimization.advantage_audiencebooleanNo
targeting.optimization.advantage_placementsbooleanNo
targeting.optimization.targeting_optimization_expansion_allbooleanNo
goalenumNoValues: UNSPECIFIED, BRAND_AWARENESS, ENGAGEMENT, REACH, WEBSITE_TRAFFIC, LEADS, SALES, APP_PROMOTION
planned_spend_amountnumberNo
frequency_capobjectNo
frequency_cap.is_unlimitedbooleanNo
frequency_cap.time_unitenumNoValues: UNSPECIFIED, LIFETIME, MONTHS, WEEKS, DAYS, HOURS, MINUTES
frequency_cap.time_unit_countnumberNo
frequency_cap.max_impressionsnumberNo
frequency_cap.max_viewsnumberNo
advertising_channel_typeenumNoValues: TEXT, IMAGE, VIDEO, RESPONSIVE, SHOPPING, APP, CALL, CAROUSEL, SOCIAL, DISPLAY, SEARCH, AUDIO, YOUTUBE, NATIVE, CTV, DOOH, PERFORMANCE_MAX
campaign_budget_identifierstringNoResource name for existing/shared budget (Google)
currencystringNo
categorystringNoHousing, employment, credit, NONE (Meta)
has_eu_political_adsbooleanNo
labelsstring[]No
kpiobjectNo
kpi.typeenumNoValues: 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.amountnumberNo
kpi.percentagenumberNo
kpi.string_valuestringNo
kpi.algorithm_idstringNo

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"
}
StatusErrorMeaning
400Bad RequestThe request was malformed or failed validation.
401UnauthorizedThe connection is likely broken; re-authorize it.
403ForbiddenThe connection is missing permissions or scopes.
404Not FoundThe requested resource does not exist.
429Too Many RequestsRate limit exceeded (see the two sources below).
500Internal Server ErrorAn unexpected error occurred.
501Not ImplementedNot 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
Was this page helpful?