create_access_rule
Create an IP, ASN, or country access rule with actions like block, challenge, or whitelist. Requires confirmation to execute; without it, returns a preview.
Instructions
Create an IP/ASN/country access rule (block, challenge, or whitelist). Requires confirm:true (human-approval gate); without it returns a preview only.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"zone_id": "<zone_id>",
"mode": "<mode>",
"target": "<target>",
"value": "<value>"
},
"name": "create_access_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zone_id | Yes | The Cloudflare zone ID (32-char hex). Get it from list_zones. | |
| mode | Yes | Action to take for matching requests. | |
| target | Yes | What the rule matches on. | |
| value | Yes | Match value, e.g. '1.2.3.4', '1.2.3.0/24', 'AS13335', or 'US'. | |
| notes | No | Optional note describing the rule. | |
| confirm | No | Human-approval gate: must be true to actually perform this mutating operation. Omit or set false to get a non-executing preview of what would happen (with secrets redacted). A human should approve before this is set to true. |