JSON object
A JSON response for the Firewall Rules API has this structure:
This table summarizes the object properties:
Priority plays a key role in configuring firewall rules. With Cloudflare Filters, it is possible to construct conflicting rules such as:
- Allow requests from the office IP range, and
- Block requests with a specific user agent.
Requests from the office IP range using the user agent to block would trigger both rules, but we cannot both allow and block the request. To solve this problem, firewall rules follows a strict ordering depending on action and priority.
Cloudflare prioritizes rules in descending order, such that priority 1 is first and rules with no priority are last. For rules of equal priority, Cloudflare orders them by action according to their order of precedence. In the example above, if no priority is set, the rule allow request from the office IP range
would apply because the allow action has a higher precedence than block.
To reduce the risk of unintended behavior, it is best to explicitly specify the desired priority for potentially conflicting rules.