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 required | Default primary text (used if primary_texts is not provided). |
landing_page_url | string required | Landing page URL (HTTPS) |
call_to_action | string optional | CTA button default: "LEARN_MORE" |
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 |
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 |
{
"arguments": {
"ad_set_id": "string",
"image_urls": [
"string"
],
"primary_text": "string",
"landing_page_url": "https://example.com",
"call_to_action": "LEARN_MORE",
"headlines": [
"string"
],
"headline": "string",
"primary_texts": [
"string"
],
"descriptions": [
"string"
],
"description": "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