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 ReadParametersExpand Collapse
ReturnsExpand Collapse
RulesetGetResponse { id, kind, last_updated, 5 more } A ruleset object.
A ruleset object.
rules: Array<BlockRule { last_updated, version, id, 10 more } | RulesetsChallengeRule { last_updated, version, id, 10 more } | CompressResponseRule { last_updated, version, id, 10 more } | 17 more>The list of rules in the ruleset.
The list of rules in the ruleset.
BlockRule { last_updated, version, id, 10 more }
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
RulesetsChallengeRule { last_updated, version, id, 10 more }
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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 { last_updated, version, id, 10 more }
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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 { last_updated, version, id, 10 more }
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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 { last_updated, version, id, 10 more }
action_parameters?: ActionParameters { id, matched_data, overrides } The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
overrides?: Overrides { 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?: Array<Category>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.
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
ForceConnectionCloseRule { last_updated, version, id, 10 more }
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
RulesetsJSChallengeRule { last_updated, version, id, 10 more }
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
LogRule { last_updated, version, id, 10 more }
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
LogCustomFieldRule { last_updated, version, id, 10 more }
action_parameters?: ActionParameters { cookie_fields, raw_response_fields, request_fields, 2 more } The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
ManagedChallengeRule { last_updated, version, id, 10 more }
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
RedirectRule { last_updated, version, id, 10 more }
action_parameters?: ActionParameters { from_list, from_value } The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
RewriteRule { last_updated, version, id, 10 more }
action_parameters?: ActionParameters { headers, uri } The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
headers?: Record<string, AddStaticHeader { operation, value } | AddDynamicHeader { expression, operation } | SetStaticHeader { operation, value } | 2 more>A map of headers to rewrite.
A map of headers to rewrite.
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
RouteRule { last_updated, version, id, 10 more }
action_parameters?: ActionParameters { host_header, origin, sni } The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
ScoreRule { last_updated, version, id, 10 more }
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
ServeErrorRule { last_updated, version, id, 10 more }
action_parameters?: ActionParametersContent { content, content_type, status_code } | ActionParametersAsset { asset_name, content_type, status_code } The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
ActionParametersContent { content, content_type, status_code }
exposed_credential_check?: ExposedCredentialCheck { password_expression, username_expression } Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit?: Ratelimit { 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.
RulesetsSetCacheControlRule { last_updated, version, id, 10 more }
action_parameters?: ActionParameters { immutable, max-age, must-revalidate, 10 more } The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
immutable?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only } A cache-control directive configuration.
A cache-control directive configuration.
"max-age"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only } A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
"must-revalidate"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only } A cache-control directive configuration.
A cache-control directive configuration.
"must-understand"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only } A cache-control directive configuration.
A cache-control directive configuration.
"no-cache"?: SetDirective { operation, cloudflare_only, qualifiers } | RemoveDirective { operation, cloudflare_only } A cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).