hermosodocs

update_meta_ad_rule

Change a Meta automated rule destructive

Area: AUTOMATED AD RULES · Ad campaign management. Generated from the running MCP server, like the rest of the tool reference.

Description

Change a rule's name, what it looks at (send scope, conditions and window TOGETHER — Meta replaces the whole evaluation), its action and/or its schedule. Never changes whether it is on (set_meta_ad_rule_status does). IF THE RULE IS ON and the new version can raise spend, this takes confirm:true plus confirmScope for the NEW version and is checked against the account caps: an edit is never a way round the switch-on gate. The answer is Meta's stored rule, read back. Free.

Parameters

ParameterTypeDescription
adAccountIdrequiredstringMeta ad account id (act_… or the bare number) from list_meta_ads; required — every rule lives on one ad account
ruleIdrequiredstringrule id from list_meta_ad_rules
namestring
scopeobjectwhat the rule looks at: level or ids (Meta requires one)
scope.level"campaign" | "adset" | "ad"campaign, adset or ad: every object at that level, INCLUDING ones created later (Meta re-resolves it each run)
scope.idsstring[]a FIXED list of campaign, ad set or ad ids instead of a level
scope.campaignIdsstring[]only objects under these campaigns
scope.adsetIdsstring[]only ads under these ad sets
scope.nameContainsstringonly objects whose name contains this
scope.statusesstring[]effective_status values, e.g. ["ACTIVE"]
conditionsobject[]when it acts (all must hold)
conditions[].fieldstringany Meta rule filter field, as Meta spells it: spent, cost_per, cpa, cpc, cpm, ctr, results, impressions, frequency, website_purchase_roas, mobile_app_purchase_roas, cost_per_purchase_fb, cost_per_lead_fb, today_spent, yesterday_spent, lifetime_spent, daily_budget, hours_since_creation …
conditions[].operatorstringGREATER_THAN, LESS_THAN, EQUAL, NOT_EQUAL, IN_RANGE, NOT_IN_RANGE, IN, NOT_IN, CONTAIN, NOT_CONTAIN
conditions[].valuestring | number | string | number[]a number, or [low, high] for IN_RANGE. MONEY IS IN THE CURRENCY BASE UNIT: for USD 1000 = $10.00
windowstringtime window for the metrics: TODAY, YESTERDAY, LAST_3_DAYS, LAST_7_DAYS, LAST_14_DAYS, LAST_30_DAYS, LIFETIME, THIS_MONTH …
attributionWindowstring
actionobjectwhat it does
action.type"pause" | "enable" | "notify" | "budget" | "bid"pause, enable (switch back on), notify, budget or bid
action.change"increase" | "decrease"increase or decrease, for budget/bid. Meta has no "set to"
action.byobjectexactly one of percent or amount
action.by.percentnumber
action.by.amountnumberin the currency base unit (cents for USD)
action.limitnumber | number[]REQUIRED for an increase: the ceiling (base unit, 5000 = $50.00). A floor for a decrease. [low, high] with targetField
action.targetFieldstringscale the budget/bid toward a target metric instead (Meta's target_field), e.g. cost_per_result
action.targetnumberthe target value for targetField
action.minMinutesBetweennumberMeta's action_frequency: minutes before the same object is changed again; default 1440 (once a day)
action.maxTimesnumberthe most times this action may run in all (execution_count_limit)
action.levelstringcampaign for a campaign budget (CBO); otherwise the ad set budget
action.userIdsstring[]Meta user ids to notify; default is the connection's user
scheduleobjecthow often Meta checks it (schedule rules)
schedule.type"DAILY" | "HOURLY" | "SEMI_HOURLY" | "CUSTOM"DAILY, HOURLY, SEMI_HOURLY or CUSTOM
schedule.timesobject[]for CUSTOM
schedule.times[].startMinutenumberminutes after midnight, account time, multiple of 30
schedule.times[].endMinutenumber
schedule.times[].daysnumber[]0 = Sunday … 6 = Saturday
triggerobjectmakes it a TRIGGER rule Meta checks in real time (no schedule; pause/enable/notify only)
trigger.typestringMETADATA_CREATION, METADATA_UPDATE, STATS_CHANGE, STATS_MILESTONE or DELIVERY_INSIGHTS_CHANGE
trigger.fieldstring
trigger.valuestring | number | boolean | string | number[]
trigger.operatorstring
evaluationSpecobjectadvanced: Meta's raw evaluation_spec, passed through as given (overrides the plain fields)
executionSpecobjectadvanced: Meta's raw execution_spec, passed through as given (overrides the plain fields)
scheduleSpecobjectadvanced: Meta's raw schedule_spec, passed through as given (overrides the plain fields)
confirmbooleantrue once the user has said yes to exactly what the refusal described
confirmScopestringthe scopeToken the list tool (or the refusal) prints; required with confirm when the rule can raise spend

Example call

Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and POST https://app.hermoso.ai/v1/tools/update_meta_ad_rule.

MCP (tools/call)

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"update_meta_ad_rule","arguments":{"adAccountId":"<string>","ruleId":"<string>"}}}

CLI

hermoso call update_meta_ad_rule --json '{"adAccountId":"<string>","ruleId":"<string>"}'

Credits

Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See Credits & costs.

All 759 Ad campaign management tools · tools.json