Create Meta Link Ad
create_meta_link_adCreates a Meta link ad (creative + ad in one step). page_id is REQUIRED — every Meta ad runs on behalf of a Facebook Page (find it with list_meta_pages). For the image give ONE of: image_hash (already uploaded via upload_meta_image — reusable, no re-upload), image_base64 (the file itself, e.g. one the user dropped into the chat) or image_url (public link). JPEG/PNG/GIF/WebP, ≤8MB. cta_type = the button: LEARN_MORE | SHOP_NOW | SIGN_UP | BUY_NOW | GET_OFFER | GET_QUOTE | CONTACT_US | APPLY_NOW | ORDER_NOW | SEND_MESSAGE | WHATSAPP_MESSAGE | INSTAGRAM_MESSAGE | VIEW_INSTAGRAM_PROFILE | CALL_NOW | BOOK_TRAVEL | DOWNLOAD | SUBSCRIBE | NO_BUTTON — leave EMPTY to auto-pick from the campaign objective (SALES→SHOP_NOW, LEADS→SIGN_UP, else LEARN_MORE). WHATSAPP_MESSAGE / SEND_MESSAGE / INSTAGRAM_MESSAGE make the button OPEN A CHAT (WhatsApp / Messenger / Instagram Direct) instead of a website — pair with a messaging ad set (optimization_goal CONVERSATIONS, destination_type WHATSAPP / MESSENGER / INSTAGRAM_DIRECT). THE BUTTON MUST MATCH THE AD SET'S destination_type: INSTAGRAM_DIRECT needs INSTAGRAM_MESSAGE (a link button such as LEARN_MORE is accepted at creation but the ad then NEVER delivers, error 1487891; MESSAGE_PAGE/SEND_MESSAGE is rejected on Instagram, subcode 2875003). Leave cta_type empty and it is derived from destination_type automatically. For those messaging ads you can PRE-FILL the chat: welcome_message = the text that auto-populates the user's WhatsApp/Messenger compose box (the ready-written message they'll tap 'send' on, e.g. 'Merhaba, indirimli fiyatlarınızdan yararlanmak istiyorum'); greeting = an optional greeting shown in the thread; ice_breakers = up to 4 tappable quick-reply options (each ≤80 chars) shown when the chat first opens (if given, these replace the auto-fill — Meta allows one or the other). These only apply when cta_type is WHATSAPP_MESSAGE / SEND_MESSAGE / INSTAGRAM_MESSAGE. BACKGROUND MUSIC / AUDIO / SOUNDTRACK: music=true is Ads Manager's "Add music" (Advantage+ audio enrollment) — Meta turns the still image into a short video with an auto-picked track; enhancements=['animate_image','image_enhancement',...] enrolls the other Advantage+ creative features. The response reports enhancements_applied vs enhancements_not_applied, so a request Meta ignores is never reported as success. INSTAGRAM IDENTITY: by default Meta derives the Instagram account from page_id, which silently picks one when the Page has several — pass instagram_user_id (from list_meta_instagram_accounts) to choose it explicitly. Either way the response returns the instagram_user_id the ad ACTUALLY runs from, so you can confirm the identity without opening Ads Manager. For a SPECIFIC song, embed it in a video and use create_meta_video_ad (or upload_meta_video + update_meta_ad_creative(video_id=...)) — the Marketing API has no field to pick a Sound Collection track. The ad is created PAUSED and goes through Meta review. LEAD ADS (Instant Form): pass lead_gen_form_id and the button opens Meta's instant form instead of a website — pair it with a LEAD_GENERATION ad set (promoted_object page_id) and cta_type SIGN_UP / APPLY_NOW / GET_QUOTE. You can build the form itself here too (create_meta_lead_form) or reuse one made in Meta Ads Manager (Page > Instant Forms) by passing its ID. If Meta answers (#200) the account was connected before this permission was granted — reconnect Meta from the panel once. confirm=false = preview.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| link | Yes | ||
| name | Yes | ||
| music | No | ||
| status | No | PAUSED | |
| confirm | No | ||
| message | Yes | ||
| page_id | Yes | ||
| adset_id | Yes | ||
| cta_type | No | ||
| greeting | No | ||
| headline | No | ||
| image_url | No | ||
| account_id | Yes | ||
| image_hash | No | ||
| enhancements | No | ||
| ice_breakers | No | ||
| image_base64 | No | ||
| welcome_message | No | ||
| lead_gen_form_id | No | ||
| instagram_user_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||