Manage Ad Template (create / update / delete)
adsap_manage_ad_templateCreate, update, or delete a saved Meta ad template (copy, CTA, destination URL, page/Instagram identity, pixel, catalog refs, enhancement toggles, site links). Completes the pair with adsap_list_ad_templates (read). Update is a PARTIAL PATCH — only the fields you pass change; the copy arrays (primary_texts/headlines/descriptions) and sitelinks replace their whole list. Enhancement toggles use the same toggle keys adsap_list_ad_templates returns in enhancement_flags. dry_run defaults TRUE: call once to preview the exact writes, confirm with the user, then call again with dry_run:false. Deleting a template does NOT touch launched ads; draft ad-sheet rows that still reference it are unlinked (the preview reports how many).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Template name. Required for create. | |
| action | Yes | "create" a new template, "update" an existing one (partial patch — only fields you pass change), or "delete" one permanently. | |
| dry_run | No | TRUE (default) = preview only: shows exactly what would be written (and, for delete, how many draft ad-sheet rows still reference the template and would be unlinked). Set false to apply. | |
| pixel_id | No | ||
| headlines | No | Up to 5 headlines. REPLACES all 5 slots. | |
| sitelinks | No | Site links shown under the ad. REPLACES the whole list; [] clears. | |
| cta_button | No | Call-to-action button (Meta enum, e.g. SHOP_NOW, LEARN_MORE, NO_BUTTON). Pass null to clear. | |
| pixel_name | No | ||
| description | No | Optional template description. Pass null to clear. | |
| template_id | No | Required for update/delete. The template id from adsap_list_ad_templates. | |
| descriptions | No | Up to 5 descriptions. REPLACES all 5 slots. | |
| display_link | No | Display link shown on the ad. Pass null to clear. | |
| enhancements | No | Partial patch of enhancement toggles keyed by toggle_key (the enhancement_flags keys returned by adsap_list_ad_templates, e.g. image_touchups, video_uncrop, carousel_enhance_cta, catalog_biz_ai, collection_hide_price, flexible_advantage_plus_creative). Only the keys you pass change. Unknown keys are rejected with the valid list. | |
| instagram_id | No | ||
| ad_account_id | No | Required for create: act_<digits>, the Meta ad account the template belongs to. Ignored on update/delete (a template cannot move accounts). | |
| primary_texts | No | Up to 5 primary texts. REPLACES all 5 slots (pass the complete list you want to keep; [] clears all). | |
| instagram_name | No | ||
| url_parameters | No | URL parameters (e.g. utm_source=...). Pass null to clear. | |
| catalog_feed_id | No | Catalog product feed id (Catalog format). Pass null to clear. | |
| url_destination | No | Destination URL. Pass null to clear. | |
| facebook_page_id | No | ||
| facebook_page_name | No | ||
| partner_instagram_id | No | ||
| catalog_product_set_id | No | Catalog product set id. Pass null to clear. | |
| partner_instagram_name | No | ||
| partner_facebook_page_id | No | ||
| partner_facebook_page_name | No |