{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/plainrouter/main/json-schema/plainrouter-action-rule-detail-read-schema.json", "title": "ActionRuleDetailRead", "x-generated": "2026-10-18", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/plainrouter-openapi.json#/components/schemas/ActionRuleDetailRead", "type": "object", "properties": { "rule": { "type": "object", "properties": { "id": { "type": "string" }, "workspace_id": { "type": "integer" }, "platform_ad_account_id": { "type": "integer" }, "name": { "type": "string" }, "enabled": { "type": "boolean" }, "suspended_at": { "type": [ "string", "null" ], "format": "date-time" }, "suspended_reason": { "type": [ "string", "null" ] }, "window": { "type": "object", "properties": { "days": { "type": "integer", "enum": [ 3 ] }, "kind": { "type": "string", "enum": [ "last_complete_days" ] }, "timezone": { "type": "string" } }, "required": [ "days", "kind", "timezone" ] }, "current_revision": { "type": "object", "properties": { "id": { "type": "string" }, "target_level": { "type": "string", "enum": [ "ad", "ad_set", "campaign" ] }, "action": { "type": "string", "enum": [ "pause", "increase_budget", "decrease_budget" ] }, "budget_change_percent": { "type": [ "integer", "null" ] }, "minimum_counted_arrivals": { "type": "integer" }, "cost_comparison": { "type": "string", "enum": [ "at_least", "at_most" ] }, "cost_ratio": { "type": "string" }, "author_type": { "type": "string", "enum": [ "user", "agent" ] }, "created_at": { "type": "string", "format": "date-time" } }, "required": [ "id", "target_level", "action", "budget_change_percent", "minimum_counted_arrivals", "cost_comparison", "cost_ratio", "author_type", "created_at" ] }, "revisions": { "type": "array", "description": "Present on show and write responses.", "items": { "type": "object", "properties": { "id": { "type": "string" }, "target_level": { "type": "string", "enum": [ "ad", "ad_set", "campaign" ] }, "action": { "type": "string", "enum": [ "pause", "increase_budget", "decrease_budget" ] }, "budget_change_percent": { "type": [ "integer", "null" ] }, "minimum_counted_arrivals": { "type": "integer" }, "cost_comparison": { "type": "string", "enum": [ "at_least", "at_most" ] }, "cost_ratio": { "type": "string" }, "author_type": { "type": "string", "enum": [ "user", "agent" ] }, "created_at": { "type": "string", "format": "date-time" } }, "required": [ "id", "target_level", "action", "budget_change_percent", "minimum_counted_arrivals", "cost_comparison", "cost_ratio", "author_type", "created_at" ] } }, "runs": { "type": "array", "description": "Show only; at most five recent runs, each with at most 100 decisions.", "items": { "type": "object", "properties": { "id": { "type": "string" }, "revision_id": { "type": "string" }, "window_start": { "type": "string", "format": "date-time" }, "window_end": { "type": "string", "format": "date-time" }, "timezone": { "type": "string" }, "status": { "type": "string" }, "reason": { "type": [ "string", "null" ] }, "account_spend_minor": { "type": [ "string", "null" ] }, "account_counted_arrivals": { "type": [ "integer", "null" ] }, "evaluated_at": { "type": [ "string", "null" ], "format": "date-time" }, "decisions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "target_type": { "type": "string" }, "target_id": { "type": "string" }, "target_name": { "type": [ "string", "null" ] }, "target_spend_minor": { "type": "string" }, "target_counted_arrivals": { "type": "integer" }, "decision": { "type": "string" }, "reason": { "type": "string" }, "action_type": { "type": "string" }, "new_daily_budget_minor": { "type": [ "integer", "null" ] }, "action_batch_id": { "type": [ "string", "null" ] } }, "required": [ "id", "target_type", "target_id", "target_name", "target_spend_minor", "target_counted_arrivals", "decision", "reason", "action_type", "new_daily_budget_minor", "action_batch_id" ] } }, "decisions_truncated": { "type": "boolean" } }, "required": [ "id", "revision_id", "window_start", "window_end", "timezone", "status", "reason", "account_spend_minor", "account_counted_arrivals", "evaluated_at", "decisions", "decisions_truncated" ] } } }, "required": [ "id", "workspace_id", "platform_ad_account_id", "name", "enabled", "suspended_at", "suspended_reason", "window", "current_revision", "revisions", "runs" ] } }, "required": [ "rule" ] }