Meta Ads Write
User wants to create a Meta (Facebook/Instagram) carousel ad campaign with multiple images
POST https://api.adspirer.ai/api/v1/tools/create_meta_carousel_campaign/execute
Authorization: Bearer sk_live_... — your Adspirer API key (required)Content-Type: application/json (required)Idempotency-Key: <uuid> — recommended for write operations to make retries safeAll tool arguments are wrapped in an arguments object.
| Field | Type | Description |
|---|---|---|
campaign_name | string required | Campaign name (will be automatically suffixed with timestamp for uniqueness) |
objective | string optional | Campaign objective. Options: 'OUTCOME_TRAFFIC' (website clicks), 'OUTCOME_SALES' (conversions), 'OUTCOME_LEADS' (lead forms), 'OUTCOME_AWARENESS' (reach), 'OUTCOME_ENGAGEMENT'. Default: OUTCOME_TRAFFIC default: "OUTCOME_TRAFFIC" |
budget_daily | number optional | Daily budget in account currency (minimum $1/day, recommended $5-20/day for testing). Mutually exclusive with budget_lifetime — provide exactly one. |
budget_lifetime | number optional | Lifetime budget in account currency (total spend over campaign duration). REQUIRES end_time to be set. Mutually exclusive with budget_daily — provide exactly one. |
end_time | string optional | Campaign/ad set end date in ISO format (e.g. '2026-04-30T23:59:59'). REQUIRED when using budget_lifetime. Optional with budget_daily. |
facebook_page_id | string optional | Facebook Page ID for the ad. Usually auto-detected from your connected account. Only provide if you have multiple pages and want to use a specific one. |
primary_text | string required | Primary ad text (max 2200 characters, recommended 125 or less for optimal display). Supports emojis, line breaks (\n), and bullet points (e.g. '🔥 Limited Offer!\n\n✅ Free Shipping\n✅ 30-Day Returns'). This is the main message that appears above the carousel. |
cards | array required | List of 2-10 carousel cards. Each card should have: image_url OR image_hash, landing_page_url, headline (max 45 chars), optional description (max 20 chars), optional call_to_action. |
call_to_action | string optional | Default call-to-action button for cards without specific CTA. Options: 'LEARN_MORE', 'SHOP_NOW', 'SIGN_UP', 'DOWNLOAD', 'BOOK_TRAVEL'. Default: LEARN_MORE default: "LEARN_MORE" |
instagram_account_id | string optional | Instagram account ID for Instagram placements. If not provided, ad will run on Facebook only. |
pixel_id | string optional | Meta Pixel ID for conversion tracking. Required for OUTCOME_SALES campaigns. Use list_meta_pixels to find available pixels for your ad account. |
pixel_event_name | string optional | Conversion event to optimize for when pixel_id is provided. Options: PURCHASE, LEAD, COMPLETE_REGISTRATION, ADD_TO_CART, INITIATE_CHECKOUT, ADD_PAYMENT_INFO, SEARCH, VIEW_CONTENT, OTHER. Use OTHER with custom_conversion_id for custom pixel events. Default: PURCHASE |
custom_conversion_id | string optional | Custom 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. Get available custom conversions from your Meta Events Manager. |
destination_type | string optional | Override the ad set destination type. By default, OUTCOME_LEADS uses ON_AD (Meta lead forms) and OUTCOME_TRAFFIC uses WEBSITE. 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. Only provide when overriding the default. |
campaign_budget_optimization | boolean optional | Enable Advantage Campaign Budget (CBO). When true, the daily budget is set at the campaign level and Meta automatically distributes it across ad sets. When false (default), each ad set manages its own budget. default: false |
daily_min_spend_target | number optional | CBO only: minimum daily spend for this ad set in account currency. Meta will try to spend at least this amount on this ad set each day. |
daily_spend_cap | number optional | CBO only: maximum daily spend cap for this ad set in account currency. Meta will not spend more than this on this ad set each day. |
locations | array optional | Location targeting. Accepts country codes (['US', 'CA']) OR location objects from search_meta_targeting ([{'key': '2421836', 'type': 'city', 'radius': 25, 'distance_unit': 'mile'}]). For city/region targeting, first call search_meta_targeting with search_type='location'. Default: ['US'] |
age_min | integer optional | Minimum age (18-65). Default: 18 default: 18 |
age_max | integer optional | Maximum age (18-65). Default: 65 default: 65 |
genders | array optional | Gender targeting: ['male'], ['female'], or None for all genders |
interests | array optional | List of interest targeting objects from search_meta_targeting. Format: [{'id': '6003139266461', 'name': 'Fitness'}]. Use search_meta_targeting with search_type='interests' to find valid IDs. |
behaviors | array optional | List of behavior targeting objects from search_meta_targeting. Format: [{'id': '6002714895372', 'name': 'Small business owners'}]. Use search_meta_targeting with search_type='behaviors' to find valid IDs. |
job_titles | array optional | List of job title targeting objects for B2B campaigns. Format: [{'id': '123456', 'name': 'Chief Marketing Officer'}]. Use search_meta_targeting with search_type='job_titles' to find valid IDs. |
work_employers | array optional | List of employer targeting objects for B2B campaigns. Format: [{'id': '123456', 'name': 'Google'}]. Use search_meta_targeting with search_type='work_employers' to find valid IDs. |
life_events | array optional | List of life event targeting objects. Format: [{'id': '123456', 'name': 'Recently engaged'}]. Use search_meta_targeting with search_type='life_events' to find valid IDs. |
education_schools | array optional | List of education school targeting objects. Format: [{'id': '123456', 'name': 'Harvard University'}]. Use search_meta_targeting with search_type='education_schools' to find valid IDs. |
education_majors | array optional | List of education major targeting objects. Format: [{'id': '123456', 'name': 'Computer Science'}]. Use search_meta_targeting with search_type='education_majors' to find valid IDs. |
custom_audiences | array optional | List of Custom Audience IDs to include in targeting. These are audiences created in Meta Ads Manager (website visitors, customer lists, etc.) |
excluded_custom_audiences | array optional | List of Custom Audience IDs to exclude from targeting. |
ad_account_id | string optional | Meta Ad Account ID. Required for multi-account users. Get from list_connected_accounts. |
special_ad_categories | array optional | Special ad categories for housing, credit, employment, or social issues. Options: 'HOUSING', 'CREDIT', 'EMPLOYMENT', 'ISSUES_ELECTIONS_POLITICS'. Leave empty for standard ads. |
lead_form_id | string optional | Lead form ID to attach when objective is OUTCOME_LEADS. Get available forms using list_meta_lead_forms tool. Only used with OUTCOME_LEADS objective. |
multi_share_optimized | boolean optional | Whether to let Meta optimize card order based on performance. Default: true (recommended). default: true |
multi_advertiser | boolean optional | Allow ad to appear in multi-advertiser ad format (multiple ads shown together). Set to false to opt out. Default: Meta's default (enabled). Brands that want exclusive placement should set this to false. |
publisher_platforms | array optional | Platforms to show ads on. Options: 'facebook', 'instagram', 'audience_network', 'messenger'. Default: automatic (all). To exclude Audience Network/Apps, use ['facebook', 'instagram']. |
facebook_positions | array optional | Facebook placement positions. Options: 'feed', 'right_hand_column', 'marketplace', 'video_feeds', 'story', 'search', 'instream_video', 'facebook_reels'. Only include positions you WANT — omitted positions are excluded. |
instagram_positions | array optional | Instagram placement positions. Options: 'stream' (feed), 'story', 'reels', 'explore', 'explore_home', 'ig_search', 'profile_feed'. Only include positions you WANT — omitted positions are excluded. |
{
"arguments": {
"campaign_name": "string",
"primary_text": "string",
"cards": [
{
"image_url": "https://example.com/card1.jpg",
"landing_page_url": "https://example.com/product/1",
"headline": "Spring Sale",
"description": "Up to 40% off",
"call_to_action": "SHOP_NOW"
},
{
"image_url": "https://example.com/card2.jpg",
"landing_page_url": "https://example.com/product/2",
"headline": "New Arrivals"
}
],
"objective": "OUTCOME_TRAFFIC",
"budget_daily": 1.0,
"budget_lifetime": 1.0,
"end_time": "string",
"facebook_page_id": "string",
"call_to_action": "LEARN_MORE"
}
}
{
"success": true,
"data": {
"text": "(tool-specific textual output for create_meta_carousel_campaign)",
"quota": {
"used": 42,
"limit": 150,
"tier": "plus",
"period_end": "2026-05-01"
}
},
"tool": "create_meta_carousel_campaign"
}
{
"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": "create_meta_carousel_campaign"
}
{
"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": "create_meta_carousel_campaign",
"quota": {
"used": 150,
"limit": 150,
"tier": "plus",
"period_end": "2026-05-01",
"upgrade_url": "https://adspirer.ai"
}
}
Interactive: Swagger UI
Machine-readable: OpenAPI 3.1 spec · llms-full.txt
Adspirer REST API — get an API key at adspirer.ai/keys · adspirer.ai