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. 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 - 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, existing_image_hash, or asset_bundle_id - `video`: Provide video_url or existing_video_id - `carousel`: Provide cards array (2-10 cards) 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 in USD for this ad set (minimum $1). 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 from validate_and_prepare_meta_assets (for image ad_type)
video_urlstring optionalPublic URL of video to upload (for video ad_type)
existing_video_idstring optionalExisting Meta video ID (for video ad_type)
thumbnail_urlstring optionalCustom thumbnail URL for video
cardsarray optionalCarousel cards (2-10). Each: {image_url, headline, landing_page_url, description?, call_to_action?}
primary_textstring requiredPrimary ad text (max 2200 chars, recommended 125). Supports emojis and line breaks.
headlinestring optionalHeadline (max 255 chars, recommended 40)
landing_page_urlstring requiredLanding page URL (HTTPS)
call_to_actionstring optionalCTA button: LEARN_MORE, SHOP_NOW, SIGN_UP, etc. default: "LEARN_MORE"
descriptionstring optionalDescription (max 255 chars, recommended 30)
locationsarray optionalLocation targeting. Country codes (['US']) or location objects from search_meta_targeting ([{'key': '2421836', 'type': 'city', 'radius': 25, 'distance_unit': 'mile'}]). Default: ['US']
age_mininteger optionaldefault: 18
age_maxinteger optionaldefault: 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 optionalConversion event: PURCHASE, LEAD, ADD_TO_CART, OTHER, etc. Use OTHER with custom_conversion_id for custom events.
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
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 in account currency for this ad set (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).
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.
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. Options: WEBSITE, ON_AD, WEBSITE_AND_ON_AD.

Example request

{
  "arguments": {
    "campaign_id": "<campaign_id>",
    "ad_type": "string",
    "primary_text": "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