{"name":"optimizer_manage","inputSchema":{"type":"object","oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"create_portfolio"},"payload":{"type":"object","properties":{"brand_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ad_account_id":{"type":"string","minLength":1},"config":{"type":"object","properties":{"name":{"type":"string","minLength":1},"objective":{"type":"string","enum":["purchase","app_install","signup","lead","traffic","awareness","conversations","link_clicks","thruplays","post_engagement","clicks","custom"]},"level":{"default":"adset","type":"string","enum":["adset","campaign"]},"mode":{"default":"balanced","type":"string","enum":["efficiency","balanced","scale"]},"apply_mode":{"default":"recommend","type":"string","enum":["observe","recommend","autopilot"]},"daily_total":{"type":"number","minimum":0},"period_budget":{"type":"number","minimum":0},"budget_source":{"default":"observed","type":"string","enum":["observed","fixed"]},"lookback_window":{"default":"d14","type":"string","enum":["d7","d14","d30"]},"period_start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"period_end":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"cpa_target":{"type":"number","exclusiveMinimum":0},"target_metric":{"type":"string","enum":["purchase","app_install","signup","lead","traffic","awareness","conversations","link_clicks","thruplays","post_engagement","clicks","custom"]},"budget_granularity":{"default":"daily","type":"string","enum":["daily","monthly","total"]},"scale_growth_pct":{"type":"number","exclusiveMinimum":0,"maximum":1},"scale_cadence_days":{"type":"integer","minimum":1,"maximum":90},"scale_max_daily":{"type":"number","exclusiveMinimum":0},"velocity_cap_pct":{"type":"number","minimum":0,"maximum":5},"max_daily_apply_minor":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_change_pct_per_cycle":{"type":"number","minimum":0},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"conversion_descriptor":{"type":"object","properties":{"event_id":{"type":"string","minLength":1},"result_label":{"type":"string","minLength":1},"cost_label":{"type":"string","minLength":1},"analog":{"type":"string","enum":["purchase","signup","lead"]},"analog_source":{"default":"inferred","type":"string","enum":["inferred","declared"]},"typical_lag_days":{"type":"number","minimum":0,"maximum":30},"events_per_week":{"type":"number","minimum":0},"carries_revenue":{"default":false,"type":"boolean"}},"required":["event_id","result_label","cost_label","analog","typical_lag_days","events_per_week"]}},"required":["name","objective","daily_total"]}},"required":["brand_id","ad_account_id","config"]}},"required":["action","payload"]},{"type":"object","properties":{"action":{"type":"string","const":"create_from_suggestion"},"payload":{"type":"object","properties":{"brand_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ad_account_id":{"type":"string","minLength":1},"suggestion":{"type":"object","properties":{"objective":{"type":"string","enum":["purchase","app_install","signup","lead","traffic","awareness","conversations","link_clicks","thruplays","post_engagement","clicks","custom"]},"name":{"type":"string"},"level":{"default":"adset","type":"string","enum":["adset","campaign"]},"mode":{"type":"string","enum":["efficiency","balanced","scale"]},"daily_total":{"type":"number","minimum":0},"cpa_target":{"type":"number","minimum":0},"adset_ids":{"type":"array","items":{"type":"string"}},"adset_names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"members":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google_ads","tiktok_ads"]},"account_id":{"type":"string"},"entity_id":{"type":"string"},"level":{"type":"string","enum":["adset","campaign"]},"name":{"type":"string"},"currency":{"type":"string"},"daily_budget":{"type":"number","minimum":0},"channel_type":{"type":"string"}},"required":["platform","account_id","entity_id","level"]}},"by_platform":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google_ads","tiktok_ads"]},"account_id":{"type":"string"},"members":{"type":"integer","minimum":0,"maximum":9007199254740991},"daily_total":{"type":"number"},"spend14":{"type":"number"},"conv14":{"type":"number"}},"required":["platform","account_id","members","daily_total","spend14","conv14"]}},"currency":{"type":"string"},"summary":{"type":"object","properties":{"adsets":{"type":"integer","minimum":0,"maximum":9007199254740991},"spend14":{"type":"number"},"conv14":{"type":"number"}},"required":["adsets","spend14","conv14"]},"reason":{"type":"string"}},"required":["objective","name","mode","daily_total","adset_ids","summary","reason"]}},"required":["brand_id","ad_account_id","suggestion"]}},"required":["action","payload"]},{"type":"object","properties":{"action":{"type":"string","const":"enroll_adsets"},"payload":{"type":"object","properties":{"portfolio_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"adset_ids":{"minItems":1,"type":"array","items":{"type":"string"}},"campaign_id":{"type":"string"},"adset_names":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["portfolio_id"]}},"required":["action","payload"]},{"type":"object","properties":{"action":{"type":"string","const":"convert_cbo"},"payload":{"type":"object","properties":{"brandId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountId":{"type":"string","minLength":1},"campaignId":{"type":"string","minLength":1},"mode":{"default":"preview","type":"string","enum":["preview","apply"]},"confirm_token":{"type":"string"}},"required":["brandId","accountId","campaignId"]}},"required":["action","payload"]},{"type":"object","properties":{"action":{"type":"string","const":"set_recommendation_status"},"payload":{"type":"object","properties":{"portfolio_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recommendation_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","approved","rejected","applied","expired"]},"expected_status":{"default":"pending","type":"string","enum":["pending","approved","rejected","applied","expired"]},"route":{"type":"string","enum":["task","generate"]}},"required":["portfolio_id","recommendation_id","status"]}},"required":["action","payload"]},{"type":"object","properties":{"action":{"type":"string","const":"set_recommendation_statuses"},"payload":{"type":"object","properties":{"portfolio_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recommendation_ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"status":{"type":"string","enum":["pending","approved","rejected","applied","expired"]},"expected_status":{"default":"pending","type":"string","enum":["pending","approved","rejected","applied","expired"]}},"required":["portfolio_id","recommendation_ids","status"]}},"required":["action","payload"]},{"type":"object","properties":{"action":{"type":"string","const":"set_renewal_task_status"},"payload":{"type":"object","properties":{"brand_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"task_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["open","done","dismissed"]},"expected_status":{"default":"open","type":"string","enum":["open","done","dismissed"]}},"required":["brand_id","task_id","status"]}},"required":["action","payload"]},{"type":"object","properties":{"action":{"type":"string","const":"update_portfolio"},"payload":{"type":"object","properties":{"portfolio_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"patch":{"type":"object","properties":{"name":{"type":"string","minLength":1},"objective":{"type":"string","enum":["purchase","app_install","signup","lead","traffic","awareness","conversations","link_clicks","thruplays","post_engagement","clicks","custom"]},"mode":{"type":"string","enum":["efficiency","balanced","scale"]},"apply_mode":{"type":"string","enum":["observe","recommend","autopilot"]},"daily_total":{"type":"number","minimum":0},"period_budget":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"budget_source":{"type":"string","enum":["observed","fixed"]},"lookback_window":{"type":"string","enum":["d7","d14","d30"]},"creative_analysis":{"type":"string","enum":["off","on"]},"autogen":{"type":"object","properties":{"enabled":{"type":"boolean"},"allowedAngles":{"maxItems":29,"type":"array","items":{"type":"string","enum":["offer_discount","offer_bundle","risk_reversal_trial","risk_reversal_guarantee","time_scarcity","stock_scarcity","social_proof_volume","social_proof_peer","authority_expert","authority_credential","transformation_before_after","transformation_aspiration","mechanism_how_it_works","mechanism_ingredient","problem_agitation","cost_of_inaction","objection_handling","comparison_alternative","comparison_competitor","convenience_time","convenience_access","identity_belonging","identity_status","value_stack","price_transparency","seasonal_occasion","launch_newness","local_proximity","unknown"]}},"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"minSwapIntervalDays":{"type":"number","minimum":0,"maximum":365},"producer":{"type":"string","enum":["image","headless"]},"headlessFormats":{"minItems":1,"maxItems":2,"type":"array","items":{"type":"string","enum":["reel","stills"]}},"language":{"type":"string","minLength":2,"maxLength":12}},"required":["enabled"]},"autopilot_scopes":{"type":"object","properties":{"budget":{"type":"boolean"},"creative_swap":{"type":"boolean"},"audience_change":{"type":"boolean"},"new_audience":{"type":"boolean"},"new_creatives":{"type":"boolean"},"budget_move":{"type":"boolean"}}},"period_start":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"period_end":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"cpa_target":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"target_metric":{"anyOf":[{"type":"string","enum":["purchase","app_install","signup","lead","traffic","awareness","conversations","link_clicks","thruplays","post_engagement","clicks","custom"]},{"type":"null"}]},"budget_granularity":{"type":"string","enum":["daily","monthly","total"]},"scale_growth_pct":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1},{"type":"null"}]},"scale_cadence_days":{"anyOf":[{"type":"integer","minimum":1,"maximum":90},{"type":"null"}]},"scale_max_daily":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"velocity_cap_pct":{"type":"number","minimum":0,"maximum":5},"max_daily_apply_minor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"max_change_pct_per_cycle":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"status":{"type":"string","enum":["active","paused","archived"]},"conversion_descriptor":{"anyOf":[{"type":"object","properties":{"event_id":{"type":"string","minLength":1},"result_label":{"type":"string","minLength":1},"cost_label":{"type":"string","minLength":1},"analog":{"type":"string","enum":["purchase","signup","lead"]},"analog_source":{"default":"inferred","type":"string","enum":["inferred","declared"]},"typical_lag_days":{"type":"number","minimum":0,"maximum":30},"events_per_week":{"type":"number","minimum":0},"carries_revenue":{"default":false,"type":"boolean"}},"required":["event_id","result_label","cost_label","analog","typical_lag_days","events_per_week"]},{"type":"null"}]}}}},"required":["portfolio_id","patch"]}},"required":["action","payload"]},{"type":"object","properties":{"action":{"type":"string","const":"archive_portfolio"},"payload":{"type":"object","properties":{"portfolio_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["portfolio_id"]}},"required":["action","payload"]},{"type":"object","properties":{"action":{"type":"string","const":"unenroll_adsets"},"payload":{"type":"object","properties":{"portfolio_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"adset_ids":{"minItems":1,"type":"array","items":{"type":"string"}}},"required":["portfolio_id","adset_ids"]}},"required":["action","payload"]},{"type":"object","properties":{"action":{"type":"string","const":"run_now"},"payload":{"type":"object","properties":{"portfolio_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"brandId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountId":{"type":"string"}},"required":["portfolio_id"]}},"required":["action","payload"]}]}}
