add_meta_ad_set

Meta Ads Write

User wants to add a new ad set to an EXISTING campaign

Endpoint

POST https://api.adspirer.ai/api/v1/tools/add_meta_ad_set/execute

Headers

Description

User wants to add a new ad set to an EXISTING campaign. The new ad set and its ad are created PAUSED and spend nothing until the user activates them (a Dynamic Creative ad set is created without an ad). Common scenarios: - Audience testing: Same ad format, different targeting/interests per ad set (e.g., "4 ad sets with different interests") - Multi-format: Different ad types (image + video + carousel) under one campaign - Budget split: Same creative, different budgets per audience segment - Scaling: Adding new audiences/markets to an existing campaign WhatsApp campaigns (destination_type='WHATSAPP'): if the customer's Page has more than one WhatsApp number, ASK WHICH ONE should receive conversations and pass whatsapp_phone_number. Leave it out and Meta picks a number itself, which may not be the one they expect. - Geographic split: Same ad, different locations per ad set - Dynamic Creative (DCO): Set is_dynamic_creative=true, then use add_meta_ad with image_urls/headlines/primary_texts CRITICAL: Each `create_meta_*_campaign` creates a NEW campaign. To add more ad sets to the SAME campaign, you MUST use this tool. NEVER call create_meta_*_campaign again for the same campaign. IMPORTANT: You need a campaign_id from a previously created campaign. Use `get_meta_campaign_details` first if you don't have the campaign_id. Supports all 3 ad types: - `image`: Provide image_url or existing_image_hash (the hash from validate_and_prepare_meta_assets or discover_meta_assets; asset_bundle_id only if that tool returned a non-null one) - `video`: Provide video_url or existing_video_id - `carousel`: Provide cards array (2-10 cards) Multiple text variations on the first ad (image or video): pass `primary_texts` / `headlines` / `descriptions` (2-5 each) instead of creating a single-text ad first. The ad is then a "Flexible" ad (not Dynamic Creative), so more ads can still be added to the ad set. After creating it, the tool reads the creative back from Meta and compares its image/video with the one uploaded: the response states the result, and if Meta did not attach it the call fails and the new ad set is removed. Dynamic Creative Optimization (DCO): - Set `is_dynamic_creative=true` when creating the ad set - Then use `add_meta_ad` with `image_urls` (2-10), `headlines` (up to 5), `primary_texts` (up to 5) to add a DCO ad - Meta automatically tests all asset combinations and optimizes delivery - DCO ad sets support only 1 ad — one ad with multiple asset variations Each ad set has INDEPENDENT: targeting, budget, schedule, pixel/conversion tracking. Shared from campaign: objective, campaign name. **CBO (Advantage Campaign Budget) campaigns:** If the campaign uses CBO (campaign_budget_optimization=true when created), you MUST: - Set `campaign_budget_optimization: true` on this tool call - Do NOT set `budget_daily` (budget is managed at campaign level) - Optionally set `daily_min_spend_target` and `daily_spend_cap` to control spend distribution If the campaign does NOT use CBO, `budget_daily` is required as usual. Workflow: 1. Create initial campaign with `create_meta_*_campaign` - get campaign_id 2. Call this tool with the campaign_id for each additional ad set 3. Use `add_meta_ad` to add more ad copies/creatives within any ad set

Request body

All tool arguments are wrapped in an arguments object.

FieldTypeDescription
campaign_idstring requiredThe Meta Campaign ID to add the ad set to (required). Get this from a prior create_meta_*_campaign call or get_meta_campaign_details.
ad_typestring requiredType of ad: 'image', 'video', or 'carousel'
budget_dailynumber optionalDaily budget for this ad set in the ad account's OWN CURRENCY as a decimal — NOT cents, and NOT converted to USD. For 20/day send 20, not 2000. Required for non-CBO campaigns. Do NOT set for CBO campaigns — budget is managed at campaign level. Use daily_min_spend_target/daily_spend_cap instead.
campaign_budget_optimizationboolean optionalSet to true if the parent campaign uses Advantage Campaign Budget (CBO). When true, budget_daily is not required and bid_strategy is skipped on the ad set. default: false
daily_min_spend_targetnumber optionalCBO only: minimum daily spend for this ad set in account currency.
daily_spend_capnumber optionalCBO only: maximum daily spend cap for this ad set in account currency.
image_urlstring optionalPublic URL of image to use (for image ad_type)
existing_image_hashstring optionalExisting Meta image hash (for image ad_type)
asset_bundle_idstring optionalAsset bundle ID (image ad_type) — only if validate_and_prepare_meta_assets returned a non-null one. For a single uploaded image it returns an image HASH; pass that via existing_image_hash instead. Never pass the literal "None".
video_urlstring optionalPublic URL of video to upload (for video ad_type)
existing_video_idstring optionalExisting Meta video ID (for video ad_type). An uploaded video asset ID, not a published Facebook Page post or Reel ID.
placement_specific_videosobject optional(video ad_type) Map of placement → video URL or existing Meta video ID, to build the ad with a different video per placement in ONE step (no throwaway starter ad). Keys: feed / stories_reels / right_column, aspect-ratio aliases feed_4x5 / square_1x1 / landscape_16x9 / vertical_9x16, and 'primary' (default video). A catch-all default rule is added automatically. Mutually exclusive with video_url / existing_video_id.
thumbnail_urlstring optionalCustom thumbnail URL for video
cardsarray optionalCarousel cards (2-10). Each: {image_url OR image_hash, headline, landing_page_url, description?, call_to_action?}. The per-card hash key is `image_hash` (the SAME Meta image-hash value validate_and_prepare_meta_assets / discover_meta_assets return — single-image tools call it `existing_image_hash`, carousel cards call it `image_hash`).
primary_textstring optionalPrimary ad text (max 2200 chars, recommended 125). **REQUIRED unless `primary_texts` is given.** Ask the user for it before calling. Supports emojis and line breaks.
headlinestring optionalHeadline (max 255 chars, recommended 40)
landing_page_urlstring required**REQUIRED.** Landing page URL (HTTPS). Ask the user for it before calling.
call_to_actionstring optionalCTA button: LEARN_MORE, SHOP_NOW, SIGN_UP, etc. default: "LEARN_MORE"
descriptionstring optionalDescription (max 255 chars, recommended 30)
primary_textsarray optionalList of primary text variations (2-5) for the ad created with this ad set. **USE THIS whenever the user gives you 2+ primary texts**: one ad, Meta tests the combinations (a Flexible ad, not Dynamic Creative, so more ads can be added to the ad set later). ad_type 'image' or 'video' only. Not supported for carousel, WhatsApp, placement_specific_videos or on-ad lead form ad sets.
headlinesarray optionalList of headline variations (2-5) for the ad created with this ad set. Same rules as primary_texts.
descriptionsarray optionalList of description variations (2-5) for the ad created with this ad set. Same rules as primary_texts.
display_linkstring optionalOptional display URL (caption) shown in the ad instead of the full landing page URL (e.g. 'brand.com'). Must match or redirect to the landing_page_url domain. NOT supported for ad_type='video'.
advantage_audienceboolean optionalAdvantage+ Audience on/off. When True, interests/behaviors/custom_audiences are treated as suggestions and Meta expands delivery beyond them. When False/None, strict filter behavior. Incompatible with special ad categories.
advantage_plus_creativeboolean optionalMeta's Advantage+ creative enhancements. True applies only to plain website ads (Traffic objective, website destination, link and button, no special ad category), single image or single video: it requests from Meta Visual touch-ups, Add overlays, Text improvements and Adjust brightness and contrast for an image, Text improvements for a video, and Meta decides which it applies. These can crop or AI-extend the image and rearrange or overlay the ad's own text; they never write new text. Features listed in disabled_creative_features are sent as off. True leaves every other ad unchanged. False sends off for every enhancement setting this tool manages. Unset copies the settings the account's newest ad turned off; anything not sent follows Meta's own setting, which for ads created through the API is usually off.
disabled_creative_featuresarray optionalList of granular Advantage+ Creative features to opt OUT of individually (image_auto_crop, enhance_cta, text_optimizations, etc.). 'standard_enhancements' rejected — Meta deprecated it in v22 and it breaks duplicate_campaign (error_subcode 3858504).
locationsarray optionalLocation targeting. Country codes (['US']) or location objects from search_meta_targeting ([{'key': '2421836', 'type': 'city', 'radius': 25, 'distance_unit': 'mile'}]). ALWAYS include the 'type' field (city/region/zip/place) on each object — a key with no type is treated as a country code and rejected by Meta. For ~dozens of cities each with a radius, pass one object per city. Default: ['US']
location_typesarray optionalDEPRECATED — do not set. Meta removed the location-targeting reach-mode ('people living in' / 'recently in' / 'travelling in'); all ad sets now reach 'people living in or recently in' the selected locations, and sending any location_types value now makes Meta reject the ad set. Leave this unset; any value you pass is ignored.
age_mininteger optional— default: 18
age_maxinteger optional— default: 65
gendersarray optional—
interestsarray optional—
behaviorsarray optional—
custom_audiencesarray optional—
excluded_custom_audiencesarray optional—
lead_form_idstring optionalLead form ID for OUTCOME_LEADS campaigns. If not provided, auto-fetched from existing campaign ads.
pixel_idstring optionalMeta Pixel ID for conversion tracking
pixel_event_namestring optionalMeta Pixel Standard Event to optimize for. Options: PURCHASE, LEAD, COMPLETE_REGISTRATION, ADD_TO_CART, INITIATED_CHECKOUT, ADD_PAYMENT_INFO, SEARCH, CONTENT_VIEW, OTHER. Use OTHER with custom_conversion_id for custom-conversion rules, or with custom_event_str for arbitrary pixel events. NOTE: LANDING_PAGE_VIEWS / LINK_CLICKS / IMPRESSIONS / REACH are `optimization_goal` values, not pixel events — do not set those here.
custom_conversion_idstring optionalCustom conversion ID for optimizing towards a specific custom conversion. When provided, pixel_event_name is ignored — Meta infers the event type from the custom conversion.
instagram_account_idstring optionalInstagram account ID
facebook_page_idstring optionalFacebook Page ID. Auto-detected when the ad account has exactly ONE promotable Page. If the account has 2+ Pages, the tool will list them and ask you to pass this — Meta has no default Page, so pick the right one for this ad. Call list_meta_pages to see the options.
ad_set_namestring optionalCustom name for the ad set
ad_namestring optionalCustom name for the ad created inside the ad set
ad_account_idstring optionalMeta ad account ID
multi_share_optimizedboolean optionalFor carousel: optimize card order default: true
budget_lifetimenumber optionalLifetime budget for this ad set in the ad account's OWN CURRENCY as a decimal (NOT cents, NOT USD; minimum 1). Mutually exclusive with budget_daily. Requires end_time to be set. Cannot be used with CBO campaigns.
end_timestring optionalEnd date/time for this ad set in ISO format (e.g., 2026-04-30T23:59:59). Required when using budget_lifetime. Optional with budget_daily.
multi_advertiserboolean optionalSet to false to opt out of Meta's multi-advertiser ad format at the creative level. When false, sets contextual_multi_ads.enroll_status=OPT_OUT on the ad creative. Default (None) = Meta's default behavior (enrolled).
url_tagsstring optionalURL parameters (e.g. 'utm_source=meta&utm_medium=cpc&utm_campaign=brand-launch') appended to the landing-page URL on every click. Use for UTM tracking. Leading '?' is stripped automatically.
publisher_platformsarray optionalWhich platforms to run on: ['facebook', 'instagram', 'audience_network', 'messenger']. Only listed platforms are included. Default: automatic (all).
facebook_positionsarray optionalFacebook placements: feed, right_hand_column, story, facebook_reels, marketplace, search, etc. Only listed positions are included.
instagram_positionsarray optionalInstagram placements: stream (feed), story, reels, explore, explore_home, ig_search, profile_feed. Only listed positions are included.
app_idstring optionalFacebook App ID (numeric). Required when adding an ad set to an OUTCOME_APP_PROMOTION campaign. NOT the iOS bundle ID or Android package name.
app_store_urlstring optionalApp Store / Play Store URL. Required when adding an ad set to an OUTCOME_APP_PROMOTION campaign. The ad set's OS targeting is set from this URL automatically (override with user_os).
user_osstring optionalOperating system to target: 'iOS' or 'Android'. Usually OMIT — derived from app_store_url. Meta REJECTS an ad set whose OS targeting disagrees with the promoted app's platform ('Mobile Targeting Mismatch').
app_event_typestring optionalOptional in-app event to optimize for (PURCHASE, LEVEL_ACHIEVED, COMPLETE_REGISTRATION, etc.). Defaults to APP_INSTALLS when omitted.
deep_link_url_iosstring optionalOptional iOS deep link (e.g. 'myapp://product/123').
deep_link_url_androidstring optionalOptional Android deep link (e.g. 'myapp://product/123').
is_dynamic_creativeboolean optionalSet to true to enable Dynamic Creative Optimization on this ad set. Meta will test combinations of images, headlines, and text to find the best performer. Only 1 ad is allowed per DCO ad set. Use with add_meta_ad's image_urls/headlines/primary_texts fields.
destination_typestring optionalOverride the ad set destination type. Set to 'WEBSITE' for OUTCOME_LEADS campaigns that track conversions on your website via Meta Pixel instead of using Meta's built-in lead form. Set to 'WHATSAPP' for a WhatsApp-native (Click-to-WhatsApp) ad set — requires the parent campaign objective to be OUTCOME_ENGAGEMENT (or OUTCOME_LEADS) and facebook_page_id. Options: WEBSITE, ON_AD, WEBSITE_AND_ON_AD, WHATSAPP.
whatsapp_welcome_messagestring optionalFor destination_type='WHATSAPP' only. The greeting shown when the WhatsApp chat opens from the ad. Ignored for non-WhatsApp ad sets.
whatsapp_phone_numberstring optionalFor destination_type='WHATSAPP' only. Which WhatsApp number should receive the conversations, as displayed on the Page (e.g. '+55 51 99999-0000'). Leave it out and Meta picks a number for the Page itself — which is what you want for a Page with a single number, but on a Page with several Meta may not pick the one you expect. Pass this (or whatsapp_phone_number_id) whenever the Page has more than one number — it is far better to name the number up front than to correct it later.
whatsapp_phone_number_idstring optionalFor destination_type='WHATSAPP' only. Alternative to whatsapp_phone_number: the WhatsApp Business phone-number ID, if you have it from Meta Business Settings. Names the same destination — pass either one, not both.
whatsapp_ice_breakersarray optionalFor destination_type='WHATSAPP' only. Quick-reply prompt buttons shown when the WhatsApp chat opens (e.g. ['See pricing', 'Book a visit']). Ignored for non-WhatsApp ad sets.
dsa_beneficiarystring optionalEU Digital Services Act beneficiary — the entity (usually the advertiser's business/legal name) that benefits from this ad. REQUIRED by Meta when the ad set targets any EU/EEA country (e.g. Spain, Germany, France). Ignored for non-EU targeting. Example: 'Acme Inc'.
dsa_payorstring optionalEU DSA payor — the entity paying for the ad. Optional; defaults to dsa_beneficiary when omitted. Only needed if the payor differs from the beneficiary.
regional_regulated_categoriesarray optionalMeta regional regulated-category declarations for non-EU regions, as a list of tokens. REQUIRED when targeting certain regions or Meta rejects the ad set: e.g. ['TAIWAN_UNIVERSAL'] for any Taiwan location (error 3858498). Other tokens: TAIWAN_FINSERV, SINGAPORE_UNIVERSAL, THAILAND_UNIVERSAL, AUSTRALIA_UNIVERSAL, AUSTRALIA_FINSERV, MALAYSIA_UNIVERSAL, BRAZIL_REGULATION, INDIA_FINSERV, US_SECURITIES_LICENSING.
regional_regulation_identitiesobject optionalMap of Meta verified-identity ids (the verified advertiser/payer) for regions that require one (Meta errors 3858634 'Advertiser is missing' / 3858636). Keys: universal_beneficiary + universal_payer for AUSTRALIA_UNIVERSAL, MALAYSIA_UNIVERSAL, THAILAND_UNIVERSAL, BRAZIL_REGULATION, US_SECURITIES_LICENSING and any other region without its own keys; taiwan_universal_*, singapore_universal_*, taiwan_finserv_*, australia_finserv_*, india_finserv_* for those categories; united_kingdom_finserv_beneficiary + united_kingdom_finserv_payer for United Kingdom financial services; thailand_new_risky_beneficiary + thailand_new_risky_payer for Thailand new-risky; taiwan_finserv_funder (a single key, no beneficiary/payer pair) for the Taiwan financial-services funder. Send BOTH beneficiary and payer (same id allowed), e.g. {'universal_beneficiary': '<id>', 'universal_payer': '<id>'}. The id is NOT a Page id; get it from get_meta_advertiser_identities (reads it off an existing ad set). Never guess an id.
optimization_goalstring optionalAd-set optimization goal (e.g. LINK_CLICKS, LANDING_PAGE_VIEWS, OFFSITE_CONVERSIONS, POST_ENGAGEMENT, REACH, LEAD_GENERATION, THRUPLAY). Optional — defaults to the objective's standard goal, or (when adding to an existing campaign) the goal the other ad sets use. Set it explicitly when a cost-cap / lowest-cost campaign requires all ad sets to share one goal, or to pick a specific goal; Meta validates it against the objective.
billing_eventstring optionalAd-set billing event (IMPRESSIONS, LINK_CLICKS, THRUPLAY, ...). Optional; defaults to the goal's standard billing event.

Example request

{
  "arguments": {
    "campaign_id": "<campaign_id>",
    "ad_type": "string",
    "landing_page_url": "https://example.com",
    "budget_daily": 1.0,
    "campaign_budget_optimization": false,
    "daily_min_spend_target": 1.0,
    "daily_spend_cap": 1.0,
    "image_url": "string",
    "existing_image_hash": "string"
  }
}

Example responses

200 — Success

{
  "success": true,
  "data": {
    "text": "(tool-specific textual output for add_meta_ad_set)",
    "quota": {
      "used": 42,
      "limit": 150,
      "tier": "plus",
      "period_end": "2026-05-01"
    }
  },
  "tool": "add_meta_ad_set"
}

400 — Tool-level error (bad arguments / multi-account selection)

{
  "success": false,
  "error": "You have 25 meta_ads accounts connected. Please specify which account to use by passing the ad_account_id parameter:\n  - Acme Holdings (ad_account_id=\"act_123456789\")\n  - Acme EU (ad_account_id=\"act_987654321\")",
  "is_error": true,
  "tool": "add_meta_ad_set"
}

402 — Quota exhausted

{
  "success": false,
  "error": "\ud83d\udea8 Monthly limit reached (150/150 tool calls on Plus tier).\nUpgrade to Pro at https://adspirer.ai to keep building.",
  "is_error": true,
  "tool": "add_meta_ad_set",
  "quota": {
    "used": 150,
    "limit": 150,
    "tier": "plus",
    "period_end": "2026-05-01",
    "upgrade_url": "https://adspirer.ai"
  }
}

Try it live


Adspirer REST API — get an API key at adspirer.ai/keys · adspirer.ai