create_adset
Create a new Meta ad set for a campaign by specifying budget, optimization goal, billing event, and targeting; it defaults to PAUSED status.
Instructions
Create a new ad set. Requires name, campaign_id, budget, optimization_goal, billing_event, and targeting. Defaults to PAUSED status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Ad set name | |
| status | No | Ad set status (default PAUSED) | PAUSED |
| end_time | No | End time (ISO 8601) | |
| dsa_payor | No | Payer of EU-targeted ads; does not automatically copy dsa_beneficiary. May use the account's saved default. | |
| targeting | Yes | JSON string of targeting spec (age_min, age_max, genders, geo_locations, interests, etc.). Advantage+ Audience automation and other flags go inside this object too, e.g. targeting_automation: {"advantage_audience":1}. As of v26.0, ad sets in the Housing, Employment, or Financial Products and Services (HEC-F) special ad categories with relaxable (non-broad) targeting must explicitly set targeting.targeting_automation.advantage_audience to 1 or 0 — omitting it now returns ADS_TARGETING__REQUIRE_EXPLICIT_ADVANTAGE_AUDIENCE_FLAG. Not required for broad/default audience setups. Also note: as of Marketing API v26.0, the Instagram Explore Feed placement was removed (explicitly specifying it in publisher_platforms/instagram_positions now returns an error) and the 'story' value in messenger_positions is silently dropped. | |
| account_id | No | Ad account ID to create the ad set in (e.g. 'act_123' or '123'). Falls back to META_AD_ACCOUNT_ID env var if omitted. | |
| bid_amount | No | Bid amount in the account currency's minor unit. Required for COST_CAP or LOWEST_COST_WITH_BID_CAP except Reach and Frequency. | |
| start_time | No | Start time (ISO 8601) | |
| campaign_id | Yes | Parent campaign ID | |
| pacing_type | No | Pacing settings. When a schedule is supplied, day_parting is required and is added if omitted. | |
| bid_strategy | No | Bid strategy: LOWEST_COST_WITHOUT_CAP, LOWEST_COST_WITH_BID_CAP, COST_CAP, LOWEST_COST_WITH_MIN_ROAS | |
| daily_budget | No | Daily budget in currency cents (e.g. '5000' = $50.00) | |
| billing_event | Yes | Billing event: APP_INSTALLS, CLICKS, IMPRESSIONS, LINK_CLICKS, NONE, OFFER_CLAIMS, PAGE_LIKES, POST_ENGAGEMENT, THRUPLAY, PURCHASE, LISTING_INTERACTION | |
| validate_only | No | Validate with Meta without creating or updating the ad set (default false) | |
| adset_schedule | No | Hourly delivery intervals (Sunday=0). Requires lifetime budgeting. Set timezone_type explicitly; Meta defaults to USER. | |
| dsa_beneficiary | No | Beneficiary of EU-targeted ads; may use the account's saved default when omitted | |
| lifetime_budget | No | Lifetime budget in currency cents | |
| promoted_object | No | JSON string of the promoted_object spec. Required for many objectives, e.g. OUTCOME_SALES needs {"pixel_id":"...","custom_event_type":"PURCHASE"}, OUTCOME_APP_PROMOTION needs {"application_id":"...","object_store_url":"..."}, OUTCOME_ENGAGEMENT page-like ads need {"page_id":"..."}. Omitting it when the objective requires one causes ad set creation to fail. | |
| attribution_spec | No | Attribution windows; Meta validates compatibility with the objective and optimization goal | |
| destination_type | No | Conversion destination, e.g. WEBSITE, APP, MESSENGER, INSTAGRAM_DIRECT, WHATSAPP | |
| optimization_goal | Yes | Optimization goal: NONE, APP_INSTALLS, AD_RECALL_LIFT, ENGAGED_USERS, EVENT_RESPONSES, IMPRESSIONS, LEAD_GENERATION, QUALITY_LEAD, LINK_CLICKS, OFFSITE_CONVERSIONS, PAGE_LIKES, POST_ENGAGEMENT, QUALITY_CALL, REACH, LANDING_PAGE_VIEWS, VISIT_INSTAGRAM_PROFILE, ENGAGED_PAGE_VIEWS, VALUE, THRUPLAY, DERIVED_EVENTS, APP_INSTALLS_AND_OFFSITE_CONVERSIONS, CONVERSATIONS, IN_APP_VALUE, MESSAGING_PURCHASE_CONVERSION, MESSAGING_DEEP_CONVERSATION_AND_FOLLOW, SUBSCRIBERS, REMINDERS_SET, MEANINGFUL_CALL_ATTEMPT, PROFILE_VISIT, PROFILE_AND_PAGE_ENGAGEMENT, ADVERTISER_SILOED_VALUE, AUTOMATIC_OBJECTIVE, MESSAGING_APPOINTMENT_CONVERSION |