Get an account or zone ruleset
Fetches the latest version of an account or zone ruleset.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYYAPI Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194Accepted Permissions (at least one required)
Mass URL Redirects WriteMass URL Redirects ReadMagic Firewall WriteMagic Firewall ReadL4 DDoS Managed Ruleset WriteL4 DDoS Managed Ruleset ReadTransform Rules WriteTransform Rules ReadSelect Configuration WriteSelect Configuration ReadAccount WAF WriteAccount WAF ReadAccount Rulesets ReadAccount Rulesets WriteLogs WriteLogs ReadPath ParametersExpand Collapse
ReturnsExpand Collapse
result: object { id, kind, last_updated, 5 more } A ruleset object.
A ruleset object.
rules: array of BlockRule { last_updated, version, id, 10 more } or object { last_updated, version, id, 10 more } or CompressResponseRule { last_updated, version, id, 10 more } or 17 moreThe list of rules in the ruleset.
The list of rules in the ruleset.
BlockRule object { last_updated, version, id, 10 more }
exposed_credential_check: optional object { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: optional object { characteristics, period, counting_expression, 5 more } An object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
Challenge object { last_updated, version, id, 10 more }
exposed_credential_check: optional object { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: optional object { characteristics, period, counting_expression, 5 more } An object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
CompressResponseRule object { last_updated, version, id, 10 more }
exposed_credential_check: optional object { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: optional object { characteristics, period, counting_expression, 5 more } An object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
DDoSDynamicRule object { last_updated, version, id, 10 more }
exposed_credential_check: optional object { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: optional object { characteristics, period, counting_expression, 5 more } An object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
ExecuteRule object { last_updated, version, id, 10 more }
action_parameters: optional object { id, matched_data, overrides } The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
overrides: optional object { action, categories, enabled, 2 more } A set of overrides to apply to the target ruleset.
A set of overrides to apply to the target ruleset.
An action to override all rules with. This option has lower precedence than rule and category overrides.
categories: optional array of object { category, action, enabled, sensitivity_level } A list of category-level overrides. This option has the second-highest precedence after rule-level overrides.
A list of category-level overrides. This option has the second-highest precedence after rule-level overrides.
Whether to enable execution of all rules. This option has lower precedence than rule and category overrides.
rules: optional array of object { id, action, enabled, 2 more } A list of rule-level overrides. This option has the highest precedence.
A list of rule-level overrides. This option has the highest precedence.