Meta Ads Write
User wants Meta to automatically TEST MULTIPLE IMAGES and find the best combination
POST https://api.adspirer.ai/api/v1/tools/create_meta_dco_ad/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 |
|---|---|---|
ad_set_id | string required | The Meta Ad Set ID. The ad set must have is_dynamic_creative=true (create one with add_meta_ad_set using is_dynamic_creative=true). |
image_urls | array required | List of 2-10 image URLs for Meta to test. Meta will try all combinations. |
primary_text | string optional | Primary text. Required unless `primary_texts` is given (then it is not needed). |
landing_page_url | string required | **REQUIRED.** Landing page URL (HTTPS). Ask the user for it before calling. |
call_to_action | string optional | CTA button default: "LEARN_MORE" |
display_link | string optional | Optional 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. |
url_tags | string optional | URL 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. |
advantage_plus_creative | boolean optional | Meta'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_features | array optional | List of granular Advantage+ Creative features to opt OUT of individually. 'standard_enhancements' rejected. |
headlines | array optional | List of headline variations (up to 5) for Meta to test. |
headline | string optional | Single headline (used if headlines is not provided). |
primary_texts | array optional | List of primary text variations (up to 5) for Meta to test. |
descriptions | array optional | List of description variations (up to 5) for Meta to test. |
description | string optional | Single description (used if descriptions is not provided). |
lead_form_id | string optional | Lead form ID for OUTCOME_LEADS campaigns. |
facebook_page_id | string optional | Facebook 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. |
instagram_account_id | string optional | Instagram account ID |
ad_name | string optional | Custom name for the DCO ad |
ad_account_id | string optional | Meta ad account ID |
deep_link_url_ios | string optional | Optional iOS deep link to open a specific app screen (e.g. 'myapp://product/123'). Only takes effect when the parent ad set's campaign is OUTCOME_APP_PROMOTION. Populates asset_feed_spec.link_urls[0].ios_url. |
deep_link_url_android | string optional | Optional Android deep link (e.g. 'myapp://product/123'). Only takes effect when the parent ad set's campaign is OUTCOME_APP_PROMOTION. Populates asset_feed_spec.link_urls[0].android_url. |
{
"arguments": {
"ad_set_id": "string",
"image_urls": [
"string"
],
"landing_page_url": "https://example.com",
"primary_text": "string",
"call_to_action": "LEARN_MORE",
"display_link": "string",
"url_tags": "string",
"advantage_plus_creative": false,
"disabled_creative_features": [
"string"
]
}
}
{
"success": true,
"data": {
"text": "(tool-specific textual output for create_meta_dco_ad)",
"quota": {
"used": 42,
"limit": 150,
"tier": "plus",
"period_end": "2026-05-01"
}
},
"tool": "create_meta_dco_ad"
}
{
"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_dco_ad"
}
{
"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_dco_ad",
"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