Create automated budget and pause rules with the Meta Marketing API Ads Rules Engine
domain: developers.facebook.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Authenticate with a Marketing API access token that has ads_management permission on the ad account.
POST to /act_<AD_ACCOUNT_ID>/adrules_library with name, evaluation_spec, and execution_spec to define the rule.
Choose a trigger-based rule (evaluated instantly as ad metadata/insights change) or a schedule-based rule (evaluated on a fixed interval) in the evaluation spec.
Define the execution_spec action to apply to matching objects, such as pausing an ad set or adjusting budget.
Set status to ENABLED to activate the rule or DISABLED to pause it without deleting it.
Verify the exact evaluation_type/execution_type enum values against the current ad-rule reference before hardcoding them, since this endpoint follows the same versioned deprecation cycle as the rest of the Marketing API.
Known gotchas
Rules live at the ad-account level in a shared adrules_library, not attached to a single campaign — one rule can span multiple campaigns, which surprises people expecting a per-campaign setting.
To temporarily suspend a rule, set status=DISABLED rather than deleting it; deletion is destructive.
A rule built against an old Graph API version's semantics can silently change behavior when Meta forces a version upgrade, since ad rules reuse the same versioned API as everything else.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?