Meta Ads (Facebook/Instagram) MCP server for Claude, ChatGPT, Perplexity & Cursor — the Meta node of Pipeboard’s 5-platform family (+ Google, TikTok, Snap, Reddit). Hosted remote MCP, badged Meta Business Partner, free plan — no self-hosting required.
Python advertisingai-agentschatgptclaudefacebook-adsinstagram-adsmcpmeta-adsmodel-context-protocolpipeboard
fix: move instagram_actor_id to top level for video creatives
Yves Junqueirac6eb5c440e8f
diff --git a/meta_ads_mcp/core/ads.py b/meta_ads_mcp/core/ads.pyindex 27fac4f..371550e 100644--- a/meta_ads_mcp/core/ads.py+++ b/meta_ads_mcp/core/ads.py@@ -841,8 +841,7 @@ async def create_ad_creative(lead_gen_form_id: Lead generation form ID for lead generation campaigns. Required when usinglead generation CTAs like 'SIGN_UP', 'GET_OFFER', 'SUBSCRIBE', etc.instagram_actor_id: Optional Instagram account ID for Instagram placements.- For video creatives, this is placed inside video_data for proper- Instagram delivery.+ Placed at the top level of the creative data for all creative types.ad_formats: List of ad format strings for asset_feed_spec (e.g., ["AUTOMATIC_FORMAT"] forFlexible ads, ["SINGLE_IMAGE"] for single image, ["SINGLE_VIDEO"] for video).When optimization_type is "DEGREES_OF_FREEDOM" with image_hashes, defaults to@@ -1133,10 +1132,6 @@ async def create_ad_creative(cta_data["value"] = cta_valuevideo_data["call_to_action"] = cta_data- # Instagram actor ID goes inside video_data for proper Instagram delivery- if instagram_actor_id:- video_data["instagram_actor_id"] = instagram_actor_id-creative_data["object_story_spec"] = {"page_id": page_id,"video_data": video_data@@ -1177,10 +1172,9 @@ async def create_ad_creative(if dynamic_creative_spec:creative_data["dynamic_creative_spec"] = dynamic_creative_spec- # For non-video creatives, instagram_actor_id goes at the top level.- # For video creatives in the simple path, it's already inside video_data above.- # For video creatives in the asset_feed_spec path, it goes at the top level.- if instagram_actor_id and (not is_video or use_asset_feed):+ # instagram_actor_id always goes at the top level of creative_data.+ # Meta API v24 rejects it inside video_data (error_subcode 1443050).+ if instagram_actor_id:creative_data["instagram_actor_id"] = instagram_actor_id# Make API request to create the creativediff --git a/tests/test_video_creatives.py b/tests/test_video_creatives.pyindex 43db9bd..a7691dc 100644--- a/tests/test_video_creatives.py+++ b/tests/test_video_creatives.py@@ -118,7 +118,7 @@ async def test_video_creative_with_thumbnail():@pytest.mark.asyncioasync def test_video_creative_with_instagram_actor_id():- """Test that instagram_actor_id goes inside video_data for simple video creatives."""+ """Test that instagram_actor_id goes at the top level for video creatives (not inside video_data)."""with patch('meta_ads_mcp.core.ads.make_api_request') as mock_api, \patch('meta_ads_mcp.core.ads._discover_pages_for_account') as mock_discover:@@ -147,10 +147,10 @@ async def test_video_creative_with_instagram_actor_id():creative_data = mock_api.call_args_list[1][0][2]video_data = creative_data["object_story_spec"]["video_data"]- # For simple video creatives, instagram_actor_id should be inside video_data- assert video_data["instagram_actor_id"] == "ig_555666"- # And NOT at the top level- assert "instagram_actor_id" not in creative_data+ # instagram_actor_id should be at the top level, NOT inside video_data+ # (Meta API v24 rejects it inside video_data with error_subcode 1443050)+ assert "instagram_actor_id" not in video_data+ assert creative_data["instagram_actor_id"] == "ig_555666"@pytest.mark.asyncio