rules_schema
Return rule vocabulary; call rules_capabilities for account event values. Access:mcp:read. Workspace and target permissions also apply.
Arguments: none.
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {},
"type": "object"
}
rules_list
List rules whose complete target set is readable. Access:mcp:read. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
limit | integer | 25 |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"limit": {
"default": 25,
"type": "integer"
}
},
"type": "object"
}
rules_get
Read the complete current rule definition for a lossless replacement. Access:mcp:read. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
rule_id | uuid | Required |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"rule_id": {
"format": "uuid",
"type": "string"
}
},
"required": [
"rule_id"
],
"type": "object"
}
rules_create
Create one rule after target and functional authorization. Access:mcp:read and mcp:write. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
payload | object | Required |
Full input schema
Full input schema
{
"$defs": {
"ConditionNode": {
"additionalProperties": false,
"description": "Condition or group node with explicit discriminating kind.",
"properties": {
"kind": {
"enum": [
"condition",
"group"
],
"type": "string"
},
"metric": {
"anyOf": [
{
"$ref": "#/$defs/MetricReferenceInput"
},
{
"$ref": "#/$defs/RuleMetricId"
},
{
"type": "null"
}
],
"default": null
},
"timeframe": {
"anyOf": [
{
"$ref": "#/$defs/MetricTimeframeInput"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"operator": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"value": {
"default": null,
"title": "Value"
},
"combinator": {
"anyOf": [
{
"enum": [
"and",
"or"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"children": {
"items": {
"$ref": "#/$defs/ConditionNode"
},
"maxItems": 50,
"type": "array"
}
},
"required": [
"kind"
],
"type": "object"
},
"DecreaseBudgetActionParameters": {
"additionalProperties": false,
"description": "Decrease parameters with an explicit account-currency floor.",
"properties": {
"mode": {
"enum": [
"percent",
"absolute"
],
"type": "string"
},
"value": {
"description": "Percent when mode is percent; major account-currency units when absolute.",
"exclusiveMinimum": 0,
"type": "number"
},
"min_daily_budget": {
"description": "Minimum allowed budget in major account-currency units (for USD, 100 means $100).",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"mode",
"value",
"min_daily_budget"
],
"type": "object"
},
"DecreaseBudgetRuleAction": {
"additionalProperties": false,
"description": "Budget decrease that cannot fall below its mandatory floor.",
"properties": {
"type": {
"const": "decrease_budget",
"type": "string"
},
"params": {
"$ref": "#/$defs/DecreaseBudgetActionParameters"
}
},
"required": [
"type",
"params"
],
"type": "object"
},
"DuplicateParameters": {
"additionalProperties": false,
"description": "Existing destination hierarchy and initial status for an ad copy.",
"properties": {
"destination_campaign_id": {
"anyOf": [
{
"maxLength": 300,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"destination_adset_id": {
"anyOf": [
{
"maxLength": 300,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"status": {
"default": "PAUSED",
"enum": [
"PAUSED",
"ACTIVE"
],
"type": "string"
}
},
"type": "object"
},
"DuplicateRuleAction": {
"additionalProperties": false,
"description": "Duplicate a target with parameters validated for its rule level.",
"properties": {
"type": {
"const": "duplicate",
"type": "string"
},
"params": {
"$ref": "#/$defs/DuplicateParameters"
}
},
"required": [
"type"
],
"type": "object"
},
"IncreaseBudgetActionParameters": {
"additionalProperties": false,
"description": "Increase parameters with an explicit account-currency ceiling.",
"properties": {
"mode": {
"enum": [
"percent",
"absolute"
],
"type": "string"
},
"value": {
"description": "Percent when mode is percent; major account-currency units when absolute.",
"exclusiveMinimum": 0,
"type": "number"
},
"max_daily_budget": {
"description": "Maximum allowed budget in major account-currency units (for USD, 100 means $100).",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"mode",
"value",
"max_daily_budget"
],
"type": "object"
},
"IncreaseBudgetRuleAction": {
"additionalProperties": false,
"description": "Budget increase that cannot exceed its mandatory ceiling.",
"properties": {
"type": {
"const": "increase_budget",
"type": "string"
},
"params": {
"$ref": "#/$defs/IncreaseBudgetActionParameters"
}
},
"required": [
"type",
"params"
],
"type": "object"
},
"MetricReferenceInput": {
"additionalProperties": false,
"description": "Immutable provider metric selector.",
"properties": {
"id": {
"$ref": "#/$defs/RuleMetricId"
},
"source_metric": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"action_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"attribution_window": {
"default": "value",
"enum": [
"value",
"1d_click",
"7d_click",
"1d_view"
],
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"MetricTimeframeInput": {
"additionalProperties": false,
"description": "Today or bounded rolling-day window.",
"properties": {
"kind": {
"enum": [
"today",
"rolling_days"
],
"type": "string"
},
"days": {
"default": 1,
"maximum": 365,
"minimum": 1,
"type": "integer"
},
"end_offset_days": {
"default": 0,
"maximum": 365,
"minimum": 0,
"type": "integer"
}
},
"required": [
"kind"
],
"type": "object"
},
"OtherRuleAction": {
"additionalProperties": false,
"description": "One non-relative-budget action validated again by Core.",
"properties": {
"type": {
"enum": [
"set_budget",
"set_status",
"add_tag",
"remove_tag",
"replace_tag",
"edit_name"
],
"type": "string"
},
"params": {
"additionalProperties": true,
"type": "object"
}
},
"required": [
"type"
],
"type": "object"
},
"RuleAction": {
"discriminator": {
"mapping": {
"add_tag": "#/$defs/OtherRuleAction",
"decrease_budget": "#/$defs/DecreaseBudgetRuleAction",
"duplicate": "#/$defs/DuplicateRuleAction",
"edit_name": "#/$defs/OtherRuleAction",
"increase_budget": "#/$defs/IncreaseBudgetRuleAction",
"remove_tag": "#/$defs/OtherRuleAction",
"replace_tag": "#/$defs/OtherRuleAction",
"set_budget": "#/$defs/OtherRuleAction",
"set_status": "#/$defs/OtherRuleAction"
},
"propertyName": "type"
},
"oneOf": [
{
"$ref": "#/$defs/IncreaseBudgetRuleAction"
},
{
"$ref": "#/$defs/DecreaseBudgetRuleAction"
},
{
"$ref": "#/$defs/DuplicateRuleAction"
},
{
"$ref": "#/$defs/OtherRuleAction"
}
]
},
"RuleCreate": {
"additionalProperties": false,
"description": "Complete canonical rule create request.",
"properties": {
"request_id": {
"format": "uuid",
"type": "string"
},
"name": {
"maxLength": 300,
"minLength": 1,
"type": "string"
},
"provider": {
"default": "meta",
"maxLength": 64,
"minLength": 1,
"type": "string"
},
"status": {
"default": "draft",
"enum": [
"draft",
"active",
"paused"
],
"type": "string"
},
"ad_account_ids": {
"items": {
"format": "uuid",
"type": "string"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
},
"level": {
"$ref": "#/$defs/RuleTargetLevel",
"default": "ad"
},
"target_filter": {
"$ref": "#/$defs/TargetFilterGroup"
},
"tasks": {
"items": {
"$ref": "#/$defs/RuleTask"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
},
"schedule": {
"$ref": "#/$defs/RuleSchedule"
},
"execution_limit": {
"anyOf": [
{
"$ref": "#/$defs/RuleExecutionLimit"
},
{
"type": "null"
}
],
"default": null
},
"dry_run": {
"default": true,
"type": "boolean"
},
"metadata": {
"additionalProperties": true,
"type": "object"
}
},
"required": [
"request_id",
"name",
"ad_account_ids",
"target_filter",
"tasks",
"schedule"
],
"type": "object"
},
"RuleExecutionLimit": {
"additionalProperties": false,
"description": "Per-rule/per-asset execution capacity inside a rolling window.",
"properties": {
"max_executions": {
"maximum": 100000,
"minimum": 1,
"type": "integer"
},
"window_seconds": {
"maximum": 31536000,
"minimum": 1,
"type": "integer"
},
"scope": {
"const": "rule_asset",
"default": "rule_asset",
"type": "string"
}
},
"required": [
"max_executions",
"window_seconds"
],
"type": "object"
},
"RuleMetricId": {
"minLength": 1,
"type": "string",
"anyOf": [
{
"enum": [
"spend",
"impressions",
"frequency",
"cpm",
"inline_link_clicks",
"meta.action:landing_page_view",
"ctr",
"cpc",
"leads",
"add_to_carts",
"meta.action:initiate_checkout",
"purchases",
"start_trials",
"purchase_value",
"cpa",
"roas",
"cost_per_start_trial",
"content_views",
"cost_per_content_view",
"content_view_value",
"searches",
"cost_per_search",
"search_value",
"wishlist_adds",
"cost_per_wishlist_add",
"wishlist_add_value",
"cost_per_add_to_cart",
"add_to_cart_value",
"checkouts",
"cost_per_checkout",
"checkout_value",
"payment_info_adds",
"cost_per_payment_info_add",
"payment_info_add_value",
"cost_per_lead",
"lead_value",
"registrations",
"cost_per_registration",
"registration_value",
"contacts",
"cost_per_contact",
"contact_value",
"scheduled_events",
"cost_per_scheduled_event",
"scheduled_event_value",
"submitted_applications",
"cost_per_submitted_application",
"submitted_application_value",
"start_trial_value",
"subscriptions",
"cost_per_subscription",
"subscription_value",
"product_customizations",
"cost_per_product_customization",
"product_customization_value",
"donations",
"cost_per_donation",
"donation_value",
"location_searches",
"cost_per_location_search",
"location_search_value",
"app_installs",
"cost_per_app_install",
"app_activations",
"cost_per_app_activation",
"app_activation_value",
"tutorial_completions",
"cost_per_tutorial_completion",
"tutorial_completion_value",
"levels_achieved",
"cost_per_level_achieved",
"level_achieved_value",
"achievements_unlocked",
"cost_per_achievement_unlocked",
"achievement_unlocked_value",
"ratings",
"cost_per_rating",
"rating_value",
"credits_spent",
"cost_per_credits_spent",
"credits_spent_value",
"app_ad_impressions",
"cost_per_app_ad_impression",
"app_ad_clicks",
"cost_per_app_ad_click",
"day_2_retention_events",
"cost_per_day_2_retention_event",
"day_7_retention_events",
"cost_per_day_7_retention_event"
]
},
{
"pattern": "^custom:[0-9a-fA-F-]{36}$"
}
]
},
"RuleSchedule": {
"additionalProperties": false,
"description": "Recurring cron or one exact offset-aware run_at instant in an IANA timezone.",
"properties": {
"cron": {
"anyOf": [
{
"maxLength": 100,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"run_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"timezone": {
"maxLength": 100,
"minLength": 1,
"type": "string"
}
},
"required": [
"timezone"
],
"type": "object"
},
"RuleTargetLevel": {
"description": "Advertising hierarchy levels that rules may target.",
"enum": [
"campaign",
"adset",
"ad"
],
"type": "string"
},
"RuleTask": {
"additionalProperties": false,
"description": "Ordered first-match rule task.",
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"anyOf": [
{
"maxLength": 300,
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"active_only": {
"default": true,
"type": "boolean"
},
"conditions": {
"$ref": "#/$defs/ConditionNode"
},
"actions": {
"items": {
"$ref": "#/$defs/RuleAction"
},
"maxItems": 10,
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"conditions",
"actions"
],
"type": "object"
},
"TargetFilterGroup": {
"additionalProperties": false,
"description": "Nested target predicates.",
"properties": {
"kind": {
"const": "group",
"default": "group",
"type": "string"
},
"combinator": {
"default": "and",
"enum": [
"and",
"or"
],
"type": "string"
},
"children": {
"items": {
"discriminator": {
"mapping": {
"filter": "#/$defs/TargetFilterPredicate",
"group": "#/$defs/TargetFilterGroup"
},
"propertyName": "kind"
},
"oneOf": [
{
"$ref": "#/$defs/TargetFilterPredicate"
},
{
"$ref": "#/$defs/TargetFilterGroup"
}
]
},
"maxItems": 50,
"type": "array"
}
},
"type": "object"
},
"TargetFilterPredicate": {
"additionalProperties": false,
"description": "One provider-neutral target predicate.",
"properties": {
"kind": {
"const": "filter",
"type": "string"
},
"attribute": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"operator": {
"maxLength": 50,
"minLength": 1,
"type": "string"
},
"value": {},
"scope": {
"default": "self",
"enum": [
"self",
"ancestor"
],
"type": "string"
},
"level": {
"anyOf": [
{
"$ref": "#/$defs/RuleTargetLevel"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"kind",
"attribute",
"operator",
"value"
],
"type": "object"
}
},
"additionalProperties": false,
"properties": {
"payload": {
"$ref": "#/$defs/RuleCreate",
"type": "object"
}
},
"required": [
"payload"
],
"type": "object"
}
rules_update
Replace one rule; first read it and preserve every unchanged field. Access:mcp:read and mcp:write. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
rule_id | uuid | Required |
payload | object | Required |
Full input schema
Full input schema
{
"$defs": {
"ConditionNode": {
"additionalProperties": false,
"description": "Condition or group node with explicit discriminating kind.",
"properties": {
"kind": {
"enum": [
"condition",
"group"
],
"type": "string"
},
"metric": {
"anyOf": [
{
"$ref": "#/$defs/MetricReferenceInput"
},
{
"$ref": "#/$defs/RuleMetricId"
},
{
"type": "null"
}
],
"default": null
},
"timeframe": {
"anyOf": [
{
"$ref": "#/$defs/MetricTimeframeInput"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"operator": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"value": {
"default": null,
"title": "Value"
},
"combinator": {
"anyOf": [
{
"enum": [
"and",
"or"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"children": {
"items": {
"$ref": "#/$defs/ConditionNode"
},
"maxItems": 50,
"type": "array"
}
},
"required": [
"kind"
],
"type": "object"
},
"DecreaseBudgetActionParameters": {
"additionalProperties": false,
"description": "Decrease parameters with an explicit account-currency floor.",
"properties": {
"mode": {
"enum": [
"percent",
"absolute"
],
"type": "string"
},
"value": {
"description": "Percent when mode is percent; major account-currency units when absolute.",
"exclusiveMinimum": 0,
"type": "number"
},
"min_daily_budget": {
"description": "Minimum allowed budget in major account-currency units (for USD, 100 means $100).",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"mode",
"value",
"min_daily_budget"
],
"type": "object"
},
"DecreaseBudgetRuleAction": {
"additionalProperties": false,
"description": "Budget decrease that cannot fall below its mandatory floor.",
"properties": {
"type": {
"const": "decrease_budget",
"type": "string"
},
"params": {
"$ref": "#/$defs/DecreaseBudgetActionParameters"
}
},
"required": [
"type",
"params"
],
"type": "object"
},
"DuplicateParameters": {
"additionalProperties": false,
"description": "Existing destination hierarchy and initial status for an ad copy.",
"properties": {
"destination_campaign_id": {
"anyOf": [
{
"maxLength": 300,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"destination_adset_id": {
"anyOf": [
{
"maxLength": 300,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"status": {
"default": "PAUSED",
"enum": [
"PAUSED",
"ACTIVE"
],
"type": "string"
}
},
"type": "object"
},
"DuplicateRuleAction": {
"additionalProperties": false,
"description": "Duplicate a target with parameters validated for its rule level.",
"properties": {
"type": {
"const": "duplicate",
"type": "string"
},
"params": {
"$ref": "#/$defs/DuplicateParameters"
}
},
"required": [
"type"
],
"type": "object"
},
"IncreaseBudgetActionParameters": {
"additionalProperties": false,
"description": "Increase parameters with an explicit account-currency ceiling.",
"properties": {
"mode": {
"enum": [
"percent",
"absolute"
],
"type": "string"
},
"value": {
"description": "Percent when mode is percent; major account-currency units when absolute.",
"exclusiveMinimum": 0,
"type": "number"
},
"max_daily_budget": {
"description": "Maximum allowed budget in major account-currency units (for USD, 100 means $100).",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"mode",
"value",
"max_daily_budget"
],
"type": "object"
},
"IncreaseBudgetRuleAction": {
"additionalProperties": false,
"description": "Budget increase that cannot exceed its mandatory ceiling.",
"properties": {
"type": {
"const": "increase_budget",
"type": "string"
},
"params": {
"$ref": "#/$defs/IncreaseBudgetActionParameters"
}
},
"required": [
"type",
"params"
],
"type": "object"
},
"MetricReferenceInput": {
"additionalProperties": false,
"description": "Immutable provider metric selector.",
"properties": {
"id": {
"$ref": "#/$defs/RuleMetricId"
},
"source_metric": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"action_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"attribution_window": {
"default": "value",
"enum": [
"value",
"1d_click",
"7d_click",
"1d_view"
],
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"MetricTimeframeInput": {
"additionalProperties": false,
"description": "Today or bounded rolling-day window.",
"properties": {
"kind": {
"enum": [
"today",
"rolling_days"
],
"type": "string"
},
"days": {
"default": 1,
"maximum": 365,
"minimum": 1,
"type": "integer"
},
"end_offset_days": {
"default": 0,
"maximum": 365,
"minimum": 0,
"type": "integer"
}
},
"required": [
"kind"
],
"type": "object"
},
"OtherRuleAction": {
"additionalProperties": false,
"description": "One non-relative-budget action validated again by Core.",
"properties": {
"type": {
"enum": [
"set_budget",
"set_status",
"add_tag",
"remove_tag",
"replace_tag",
"edit_name"
],
"type": "string"
},
"params": {
"additionalProperties": true,
"type": "object"
}
},
"required": [
"type"
],
"type": "object"
},
"RuleAction": {
"discriminator": {
"mapping": {
"add_tag": "#/$defs/OtherRuleAction",
"decrease_budget": "#/$defs/DecreaseBudgetRuleAction",
"duplicate": "#/$defs/DuplicateRuleAction",
"edit_name": "#/$defs/OtherRuleAction",
"increase_budget": "#/$defs/IncreaseBudgetRuleAction",
"remove_tag": "#/$defs/OtherRuleAction",
"replace_tag": "#/$defs/OtherRuleAction",
"set_budget": "#/$defs/OtherRuleAction",
"set_status": "#/$defs/OtherRuleAction"
},
"propertyName": "type"
},
"oneOf": [
{
"$ref": "#/$defs/IncreaseBudgetRuleAction"
},
{
"$ref": "#/$defs/DecreaseBudgetRuleAction"
},
{
"$ref": "#/$defs/DuplicateRuleAction"
},
{
"$ref": "#/$defs/OtherRuleAction"
}
]
},
"RuleExecutionLimit": {
"additionalProperties": false,
"description": "Per-rule/per-asset execution capacity inside a rolling window.",
"properties": {
"max_executions": {
"maximum": 100000,
"minimum": 1,
"type": "integer"
},
"window_seconds": {
"maximum": 31536000,
"minimum": 1,
"type": "integer"
},
"scope": {
"const": "rule_asset",
"default": "rule_asset",
"type": "string"
}
},
"required": [
"max_executions",
"window_seconds"
],
"type": "object"
},
"RuleMetricId": {
"minLength": 1,
"type": "string",
"anyOf": [
{
"enum": [
"spend",
"impressions",
"frequency",
"cpm",
"inline_link_clicks",
"meta.action:landing_page_view",
"ctr",
"cpc",
"leads",
"add_to_carts",
"meta.action:initiate_checkout",
"purchases",
"start_trials",
"purchase_value",
"cpa",
"roas",
"cost_per_start_trial",
"content_views",
"cost_per_content_view",
"content_view_value",
"searches",
"cost_per_search",
"search_value",
"wishlist_adds",
"cost_per_wishlist_add",
"wishlist_add_value",
"cost_per_add_to_cart",
"add_to_cart_value",
"checkouts",
"cost_per_checkout",
"checkout_value",
"payment_info_adds",
"cost_per_payment_info_add",
"payment_info_add_value",
"cost_per_lead",
"lead_value",
"registrations",
"cost_per_registration",
"registration_value",
"contacts",
"cost_per_contact",
"contact_value",
"scheduled_events",
"cost_per_scheduled_event",
"scheduled_event_value",
"submitted_applications",
"cost_per_submitted_application",
"submitted_application_value",
"start_trial_value",
"subscriptions",
"cost_per_subscription",
"subscription_value",
"product_customizations",
"cost_per_product_customization",
"product_customization_value",
"donations",
"cost_per_donation",
"donation_value",
"location_searches",
"cost_per_location_search",
"location_search_value",
"app_installs",
"cost_per_app_install",
"app_activations",
"cost_per_app_activation",
"app_activation_value",
"tutorial_completions",
"cost_per_tutorial_completion",
"tutorial_completion_value",
"levels_achieved",
"cost_per_level_achieved",
"level_achieved_value",
"achievements_unlocked",
"cost_per_achievement_unlocked",
"achievement_unlocked_value",
"ratings",
"cost_per_rating",
"rating_value",
"credits_spent",
"cost_per_credits_spent",
"credits_spent_value",
"app_ad_impressions",
"cost_per_app_ad_impression",
"app_ad_clicks",
"cost_per_app_ad_click",
"day_2_retention_events",
"cost_per_day_2_retention_event",
"day_7_retention_events",
"cost_per_day_7_retention_event"
]
},
{
"pattern": "^custom:[0-9a-fA-F-]{36}$"
}
]
},
"RuleSchedule": {
"additionalProperties": false,
"description": "Recurring cron or one exact offset-aware run_at instant in an IANA timezone.",
"properties": {
"cron": {
"anyOf": [
{
"maxLength": 100,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"run_at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"timezone": {
"maxLength": 100,
"minLength": 1,
"type": "string"
}
},
"required": [
"timezone"
],
"type": "object"
},
"RuleTargetLevel": {
"description": "Advertising hierarchy levels that rules may target.",
"enum": [
"campaign",
"adset",
"ad"
],
"type": "string"
},
"RuleTask": {
"additionalProperties": false,
"description": "Ordered first-match rule task.",
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"anyOf": [
{
"maxLength": 300,
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"active_only": {
"default": true,
"type": "boolean"
},
"conditions": {
"$ref": "#/$defs/ConditionNode"
},
"actions": {
"items": {
"$ref": "#/$defs/RuleAction"
},
"maxItems": 10,
"minItems": 1,
"type": "array"
}
},
"required": [
"id",
"conditions",
"actions"
],
"type": "object"
},
"RuleUpdate": {
"additionalProperties": false,
"properties": {
"request_id": {
"format": "uuid",
"type": "string"
},
"name": {
"maxLength": 300,
"minLength": 1,
"type": "string"
},
"provider": {
"default": "meta",
"maxLength": 64,
"minLength": 1,
"type": "string"
},
"status": {
"default": "draft",
"enum": [
"draft",
"active",
"paused"
],
"type": "string"
},
"ad_account_ids": {
"items": {
"format": "uuid",
"type": "string"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
},
"level": {
"$ref": "#/$defs/RuleTargetLevel",
"default": "ad"
},
"target_filter": {
"$ref": "#/$defs/TargetFilterGroup"
},
"tasks": {
"items": {
"$ref": "#/$defs/RuleTask"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
},
"schedule": {
"$ref": "#/$defs/RuleSchedule"
},
"execution_limit": {
"anyOf": [
{
"$ref": "#/$defs/RuleExecutionLimit"
},
{
"type": "null"
}
],
"default": null
},
"dry_run": {
"default": true,
"type": "boolean"
},
"metadata": {
"additionalProperties": true,
"type": "object"
},
"expected_version": {
"minimum": 1,
"type": "integer"
}
},
"required": [
"request_id",
"name",
"ad_account_ids",
"target_filter",
"tasks",
"schedule",
"expected_version"
],
"type": "object"
},
"TargetFilterGroup": {
"additionalProperties": false,
"description": "Nested target predicates.",
"properties": {
"kind": {
"const": "group",
"default": "group",
"type": "string"
},
"combinator": {
"default": "and",
"enum": [
"and",
"or"
],
"type": "string"
},
"children": {
"items": {
"discriminator": {
"mapping": {
"filter": "#/$defs/TargetFilterPredicate",
"group": "#/$defs/TargetFilterGroup"
},
"propertyName": "kind"
},
"oneOf": [
{
"$ref": "#/$defs/TargetFilterPredicate"
},
{
"$ref": "#/$defs/TargetFilterGroup"
}
]
},
"maxItems": 50,
"type": "array"
}
},
"type": "object"
},
"TargetFilterPredicate": {
"additionalProperties": false,
"description": "One provider-neutral target predicate.",
"properties": {
"kind": {
"const": "filter",
"type": "string"
},
"attribute": {
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"operator": {
"maxLength": 50,
"minLength": 1,
"type": "string"
},
"value": {},
"scope": {
"default": "self",
"enum": [
"self",
"ancestor"
],
"type": "string"
},
"level": {
"anyOf": [
{
"$ref": "#/$defs/RuleTargetLevel"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"kind",
"attribute",
"operator",
"value"
],
"type": "object"
}
},
"additionalProperties": false,
"properties": {
"rule_id": {
"format": "uuid",
"type": "string"
},
"payload": {
"$ref": "#/$defs/RuleUpdate",
"type": "object"
}
},
"required": [
"rule_id",
"payload"
],
"type": "object"
}
rules_change_status
Change rule status after current target authorization. Access:mcp:read and mcp:write. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
rule_id | uuid | Required |
expected_version | integer | Required |
status | string | Required |
request_id | uuid | Required |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"rule_id": {
"format": "uuid",
"type": "string"
},
"expected_version": {
"type": "integer"
},
"status": {
"type": "string"
},
"request_id": {
"format": "uuid",
"type": "string"
}
},
"required": [
"rule_id",
"expected_version",
"status",
"request_id"
],
"type": "object"
}
rules_delete
Archive one authorized rule. Access:mcp:read and mcp:write. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
rule_id | uuid | Required |
expected_version | integer | Required |
request_id | uuid | Required |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"rule_id": {
"format": "uuid",
"type": "string"
},
"expected_version": {
"type": "integer"
},
"request_id": {
"format": "uuid",
"type": "string"
}
},
"required": [
"rule_id",
"expected_version",
"request_id"
],
"type": "object"
}
rules_changes
List immutable changes for an authorized rule. Access:mcp:read. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
rule_id | uuid | Required |
limit | integer | 25 |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"rule_id": {
"format": "uuid",
"type": "string"
},
"limit": {
"default": 25,
"type": "integer"
}
},
"required": [
"rule_id"
],
"type": "object"
}
rules_run
Accept one idempotent durable rule run. Access:mcp:read and mcp:write. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
rule_id | uuid | Required |
version | integer | Required |
request_id | uuid | Required |
dry_run | boolean | true |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"rule_id": {
"format": "uuid",
"type": "string"
},
"version": {
"type": "integer"
},
"request_id": {
"format": "uuid",
"type": "string"
},
"dry_run": {
"default": true,
"type": "boolean"
}
},
"required": [
"rule_id",
"version",
"request_id"
],
"type": "object"
}
rule_runs_list
List authorized rule runs. Access:mcp:read. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
limit | integer | 25 |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"limit": {
"default": 25,
"type": "integer"
}
},
"type": "object"
}
rule_runs_get
Read one authorized rule run. Access:mcp:read. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
run_id | uuid | Required |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"run_id": {
"format": "uuid",
"type": "string"
}
},
"required": [
"run_id"
],
"type": "object"
}
rule_activity_list
List authorized rule activity records. Access:mcp:read. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
limit | integer | 25 |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"limit": {
"default": 25,
"type": "integer"
}
},
"type": "object"
}
rule_activity_get
Read one authorized rule activity record. Access:mcp:read. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
activity_id | uuid | Required |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"activity_id": {
"format": "uuid",
"type": "string"
}
},
"required": [
"activity_id"
],
"type": "object"
}
rule_activity_summary
Return a bounded activity summary for one authorized rule. Access:mcp:read. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
rule_id | uuid | Required |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"rule_id": {
"format": "uuid",
"type": "string"
}
},
"required": [
"rule_id"
],
"type": "object"
}
rules_capabilities
List authorized rule metrics and recorded event availability for one account. Call before writing event conditions. Additional monetary event values require actual stored reporting; observed does not establish optimization eligibility. Access:mcp:read. Workspace and target permissions also apply.
| Parameter | Type | Required / default |
|---|---|---|
ad_account_id | uuid | Required |
level | campaign, adset, ad | "ad" |
Full input schema
Full input schema
{
"additionalProperties": false,
"properties": {
"ad_account_id": {
"format": "uuid",
"type": "string"
},
"level": {
"description": "Advertising hierarchy levels that rules may target.",
"enum": [
"campaign",
"adset",
"ad"
],
"type": "string",
"default": "ad"
}
},
"required": [
"ad_account_id"
],
"type": "object"
}