Get an account or zone entry point ruleset
Fetches the latest version of the account or zone entry point ruleset for a given phase.
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
A result.
A result.
class UnionMember0: …
rules: Optional[List[UnionMember0Rule]]The list of rules in the ruleset.
The list of rules in the ruleset.
class UnionMember0RuleChallengeRule: …
exposed_credential_check: Optional[UnionMember0RuleChallengeRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember0RuleChallengeRuleRatelimit]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.
class UnionMember0RuleJavaScriptChallengeRule: …
exposed_credential_check: Optional[UnionMember0RuleJavaScriptChallengeRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember0RuleJavaScriptChallengeRuleRatelimit]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.
class UnionMember0RuleSetCacheControlRule: …
action_parameters: Optional[UnionMember0RuleSetCacheControlRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
immutable: Optional[UnionMember0RuleSetCacheControlRuleActionParametersImmutable]A cache-control directive configuration.
A cache-control directive configuration.
max_age: Optional[UnionMember0RuleSetCacheControlRuleActionParametersMaxAge]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: Optional[UnionMember0RuleSetCacheControlRuleActionParametersMustRevalidate]A cache-control directive configuration.
A cache-control directive configuration.
must_understand: Optional[UnionMember0RuleSetCacheControlRuleActionParametersMustUnderstand]A cache-control directive configuration.
A cache-control directive configuration.
no_cache: Optional[UnionMember0RuleSetCacheControlRuleActionParametersNoCache]A cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
class UnionMember0RuleSetCacheControlRuleActionParametersNoCacheSetDirective: …Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
no_store: Optional[UnionMember0RuleSetCacheControlRuleActionParametersNoStore]A cache-control directive configuration.
A cache-control directive configuration.
no_transform: Optional[UnionMember0RuleSetCacheControlRuleActionParametersNoTransform]A cache-control directive configuration.
A cache-control directive configuration.
private: Optional[UnionMember0RuleSetCacheControlRuleActionParametersPrivate]A cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
class UnionMember0RuleSetCacheControlRuleActionParametersPrivateSetDirective: …Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
proxy_revalidate: Optional[UnionMember0RuleSetCacheControlRuleActionParametersProxyRevalidate]A cache-control directive configuration.
A cache-control directive configuration.
public: Optional[UnionMember0RuleSetCacheControlRuleActionParametersPublic]A cache-control directive configuration.
A cache-control directive configuration.
s_maxage: Optional[UnionMember0RuleSetCacheControlRuleActionParametersSMaxage]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
stale_if_error: Optional[UnionMember0RuleSetCacheControlRuleActionParametersStaleIfError]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
stale_while_revalidate: Optional[UnionMember0RuleSetCacheControlRuleActionParametersStaleWhileRevalidate]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
exposed_credential_check: Optional[UnionMember0RuleSetCacheControlRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember0RuleSetCacheControlRuleRatelimit]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.
class UnionMember0RuleSetCacheTagsRule: …
action_parameters: Optional[UnionMember0RuleSetCacheTagsRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
class UnionMember0RuleSetCacheTagsRuleActionParametersAddCacheTagsValues: …Add cache tags using a list of values.
Add cache tags using a list of values.
class UnionMember0RuleSetCacheTagsRuleActionParametersAddCacheTagsExpression: …Add cache tags using an expression.
Add cache tags using an expression.
class UnionMember0RuleSetCacheTagsRuleActionParametersRemoveCacheTagsValues: …Remove cache tags using a list of values.
Remove cache tags using a list of values.
class UnionMember0RuleSetCacheTagsRuleActionParametersRemoveCacheTagsExpression: …Remove cache tags using an expression.
Remove cache tags using an expression.
class UnionMember0RuleSetCacheTagsRuleActionParametersSetCacheTagsValues: …Set cache tags using a list of values.
Set cache tags using a list of values.
exposed_credential_check: Optional[UnionMember0RuleSetCacheTagsRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember0RuleSetCacheTagsRuleRatelimit]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.
class UnionMember0RuleTransformResponseHTMLRule: …
action_parameters: Optional[UnionMember0RuleTransformResponseHTMLRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
exposed_credential_check: Optional[UnionMember0RuleTransformResponseHTMLRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember0RuleTransformResponseHTMLRuleRatelimit]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.
class UnionMember1: …
rules: Optional[List[UnionMember1Rule]]The list of rules in the ruleset.
The list of rules in the ruleset.
class UnionMember1RuleChallengeRule: …
exposed_credential_check: Optional[UnionMember1RuleChallengeRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember1RuleChallengeRuleRatelimit]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.
class UnionMember1RuleJavaScriptChallengeRule: …
exposed_credential_check: Optional[UnionMember1RuleJavaScriptChallengeRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember1RuleJavaScriptChallengeRuleRatelimit]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.
class UnionMember1RuleSetCacheControlRule: …
action_parameters: Optional[UnionMember1RuleSetCacheControlRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
immutable: Optional[UnionMember1RuleSetCacheControlRuleActionParametersImmutable]A cache-control directive configuration.
A cache-control directive configuration.
max_age: Optional[UnionMember1RuleSetCacheControlRuleActionParametersMaxAge]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: Optional[UnionMember1RuleSetCacheControlRuleActionParametersMustRevalidate]A cache-control directive configuration.
A cache-control directive configuration.
must_understand: Optional[UnionMember1RuleSetCacheControlRuleActionParametersMustUnderstand]A cache-control directive configuration.
A cache-control directive configuration.
no_cache: Optional[UnionMember1RuleSetCacheControlRuleActionParametersNoCache]A cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
class UnionMember1RuleSetCacheControlRuleActionParametersNoCacheSetDirective: …Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
no_store: Optional[UnionMember1RuleSetCacheControlRuleActionParametersNoStore]A cache-control directive configuration.
A cache-control directive configuration.
no_transform: Optional[UnionMember1RuleSetCacheControlRuleActionParametersNoTransform]A cache-control directive configuration.
A cache-control directive configuration.
private: Optional[UnionMember1RuleSetCacheControlRuleActionParametersPrivate]A cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
class UnionMember1RuleSetCacheControlRuleActionParametersPrivateSetDirective: …Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
proxy_revalidate: Optional[UnionMember1RuleSetCacheControlRuleActionParametersProxyRevalidate]A cache-control directive configuration.
A cache-control directive configuration.
public: Optional[UnionMember1RuleSetCacheControlRuleActionParametersPublic]A cache-control directive configuration.
A cache-control directive configuration.
s_maxage: Optional[UnionMember1RuleSetCacheControlRuleActionParametersSMaxage]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
stale_if_error: Optional[UnionMember1RuleSetCacheControlRuleActionParametersStaleIfError]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
stale_while_revalidate: Optional[UnionMember1RuleSetCacheControlRuleActionParametersStaleWhileRevalidate]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
exposed_credential_check: Optional[UnionMember1RuleSetCacheControlRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember1RuleSetCacheControlRuleRatelimit]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.
class UnionMember1RuleSetCacheTagsRule: …
action_parameters: Optional[UnionMember1RuleSetCacheTagsRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
class UnionMember1RuleSetCacheTagsRuleActionParametersAddCacheTagsValues: …Add cache tags using a list of values.
Add cache tags using a list of values.
class UnionMember1RuleSetCacheTagsRuleActionParametersAddCacheTagsExpression: …Add cache tags using an expression.
Add cache tags using an expression.
class UnionMember1RuleSetCacheTagsRuleActionParametersRemoveCacheTagsValues: …Remove cache tags using a list of values.
Remove cache tags using a list of values.
class UnionMember1RuleSetCacheTagsRuleActionParametersRemoveCacheTagsExpression: …Remove cache tags using an expression.
Remove cache tags using an expression.
class UnionMember1RuleSetCacheTagsRuleActionParametersSetCacheTagsValues: …Set cache tags using a list of values.
Set cache tags using a list of values.
exposed_credential_check: Optional[UnionMember1RuleSetCacheTagsRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember1RuleSetCacheTagsRuleRatelimit]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.
class UnionMember1RuleTransformResponseHTMLRule: …
action_parameters: Optional[UnionMember1RuleTransformResponseHTMLRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
exposed_credential_check: Optional[UnionMember1RuleTransformResponseHTMLRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember1RuleTransformResponseHTMLRuleRatelimit]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.
class UnionMember2: …
rules: Optional[List[UnionMember2Rule]]The list of rules in the ruleset.
The list of rules in the ruleset.
class UnionMember2RuleChallengeRule: …
exposed_credential_check: Optional[UnionMember2RuleChallengeRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember2RuleChallengeRuleRatelimit]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.
class UnionMember2RuleJavaScriptChallengeRule: …
exposed_credential_check: Optional[UnionMember2RuleJavaScriptChallengeRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember2RuleJavaScriptChallengeRuleRatelimit]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.
class UnionMember2RuleSetCacheControlRule: …
action_parameters: Optional[UnionMember2RuleSetCacheControlRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
immutable: Optional[UnionMember2RuleSetCacheControlRuleActionParametersImmutable]A cache-control directive configuration.
A cache-control directive configuration.
max_age: Optional[UnionMember2RuleSetCacheControlRuleActionParametersMaxAge]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: Optional[UnionMember2RuleSetCacheControlRuleActionParametersMustRevalidate]A cache-control directive configuration.
A cache-control directive configuration.
must_understand: Optional[UnionMember2RuleSetCacheControlRuleActionParametersMustUnderstand]A cache-control directive configuration.
A cache-control directive configuration.
no_cache: Optional[UnionMember2RuleSetCacheControlRuleActionParametersNoCache]A cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
class UnionMember2RuleSetCacheControlRuleActionParametersNoCacheSetDirective: …Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
no_store: Optional[UnionMember2RuleSetCacheControlRuleActionParametersNoStore]A cache-control directive configuration.
A cache-control directive configuration.
no_transform: Optional[UnionMember2RuleSetCacheControlRuleActionParametersNoTransform]A cache-control directive configuration.
A cache-control directive configuration.
private: Optional[UnionMember2RuleSetCacheControlRuleActionParametersPrivate]A cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
class UnionMember2RuleSetCacheControlRuleActionParametersPrivateSetDirective: …Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
proxy_revalidate: Optional[UnionMember2RuleSetCacheControlRuleActionParametersProxyRevalidate]A cache-control directive configuration.
A cache-control directive configuration.
public: Optional[UnionMember2RuleSetCacheControlRuleActionParametersPublic]A cache-control directive configuration.
A cache-control directive configuration.
s_maxage: Optional[UnionMember2RuleSetCacheControlRuleActionParametersSMaxage]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
stale_if_error: Optional[UnionMember2RuleSetCacheControlRuleActionParametersStaleIfError]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
stale_while_revalidate: Optional[UnionMember2RuleSetCacheControlRuleActionParametersStaleWhileRevalidate]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
exposed_credential_check: Optional[UnionMember2RuleSetCacheControlRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember2RuleSetCacheControlRuleRatelimit]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.
class UnionMember2RuleSetCacheTagsRule: …
action_parameters: Optional[UnionMember2RuleSetCacheTagsRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
class UnionMember2RuleSetCacheTagsRuleActionParametersAddCacheTagsValues: …Add cache tags using a list of values.
Add cache tags using a list of values.
class UnionMember2RuleSetCacheTagsRuleActionParametersAddCacheTagsExpression: …Add cache tags using an expression.
Add cache tags using an expression.
class UnionMember2RuleSetCacheTagsRuleActionParametersRemoveCacheTagsValues: …Remove cache tags using a list of values.
Remove cache tags using a list of values.
class UnionMember2RuleSetCacheTagsRuleActionParametersRemoveCacheTagsExpression: …Remove cache tags using an expression.
Remove cache tags using an expression.
class UnionMember2RuleSetCacheTagsRuleActionParametersSetCacheTagsValues: …Set cache tags using a list of values.
Set cache tags using a list of values.
exposed_credential_check: Optional[UnionMember2RuleSetCacheTagsRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember2RuleSetCacheTagsRuleRatelimit]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.
class UnionMember2RuleTransformResponseHTMLRule: …
action_parameters: Optional[UnionMember2RuleTransformResponseHTMLRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
exposed_credential_check: Optional[UnionMember2RuleTransformResponseHTMLRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember2RuleTransformResponseHTMLRuleRatelimit]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.
class UnionMember3: …
rules: Optional[List[UnionMember3Rule]]The list of rules in the ruleset.
The list of rules in the ruleset.
class UnionMember3RuleChallengeRule: …
exposed_credential_check: Optional[UnionMember3RuleChallengeRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember3RuleChallengeRuleRatelimit]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.
class UnionMember3RuleJavaScriptChallengeRule: …
exposed_credential_check: Optional[UnionMember3RuleJavaScriptChallengeRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember3RuleJavaScriptChallengeRuleRatelimit]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.
class UnionMember3RuleSetCacheControlRule: …
action_parameters: Optional[UnionMember3RuleSetCacheControlRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
immutable: Optional[UnionMember3RuleSetCacheControlRuleActionParametersImmutable]A cache-control directive configuration.
A cache-control directive configuration.
max_age: Optional[UnionMember3RuleSetCacheControlRuleActionParametersMaxAge]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: Optional[UnionMember3RuleSetCacheControlRuleActionParametersMustRevalidate]A cache-control directive configuration.
A cache-control directive configuration.
must_understand: Optional[UnionMember3RuleSetCacheControlRuleActionParametersMustUnderstand]A cache-control directive configuration.
A cache-control directive configuration.
no_cache: Optional[UnionMember3RuleSetCacheControlRuleActionParametersNoCache]A cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
class UnionMember3RuleSetCacheControlRuleActionParametersNoCacheSetDirective: …Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
no_store: Optional[UnionMember3RuleSetCacheControlRuleActionParametersNoStore]A cache-control directive configuration.
A cache-control directive configuration.
no_transform: Optional[UnionMember3RuleSetCacheControlRuleActionParametersNoTransform]A cache-control directive configuration.
A cache-control directive configuration.
private: Optional[UnionMember3RuleSetCacheControlRuleActionParametersPrivate]A cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
class UnionMember3RuleSetCacheControlRuleActionParametersPrivateSetDirective: …Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
proxy_revalidate: Optional[UnionMember3RuleSetCacheControlRuleActionParametersProxyRevalidate]A cache-control directive configuration.
A cache-control directive configuration.
public: Optional[UnionMember3RuleSetCacheControlRuleActionParametersPublic]A cache-control directive configuration.
A cache-control directive configuration.
s_maxage: Optional[UnionMember3RuleSetCacheControlRuleActionParametersSMaxage]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
stale_if_error: Optional[UnionMember3RuleSetCacheControlRuleActionParametersStaleIfError]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
stale_while_revalidate: Optional[UnionMember3RuleSetCacheControlRuleActionParametersStaleWhileRevalidate]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
exposed_credential_check: Optional[UnionMember3RuleSetCacheControlRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember3RuleSetCacheControlRuleRatelimit]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.
class UnionMember3RuleSetCacheTagsRule: …
action_parameters: Optional[UnionMember3RuleSetCacheTagsRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
class UnionMember3RuleSetCacheTagsRuleActionParametersAddCacheTagsValues: …Add cache tags using a list of values.
Add cache tags using a list of values.
class UnionMember3RuleSetCacheTagsRuleActionParametersAddCacheTagsExpression: …Add cache tags using an expression.
Add cache tags using an expression.
class UnionMember3RuleSetCacheTagsRuleActionParametersRemoveCacheTagsValues: …Remove cache tags using a list of values.
Remove cache tags using a list of values.
class UnionMember3RuleSetCacheTagsRuleActionParametersRemoveCacheTagsExpression: …Remove cache tags using an expression.
Remove cache tags using an expression.
class UnionMember3RuleSetCacheTagsRuleActionParametersSetCacheTagsValues: …Set cache tags using a list of values.
Set cache tags using a list of values.
exposed_credential_check: Optional[UnionMember3RuleSetCacheTagsRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember3RuleSetCacheTagsRuleRatelimit]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.
class UnionMember3RuleTransformResponseHTMLRule: …
action_parameters: Optional[UnionMember3RuleTransformResponseHTMLRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
exposed_credential_check: Optional[UnionMember3RuleTransformResponseHTMLRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember3RuleTransformResponseHTMLRuleRatelimit]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.
class UnionMember4: …
rules: Optional[List[UnionMember4Rule]]The list of rules in the ruleset.
The list of rules in the ruleset.
class UnionMember4RuleChallengeRule: …
exposed_credential_check: Optional[UnionMember4RuleChallengeRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember4RuleChallengeRuleRatelimit]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.
class UnionMember4RuleJavaScriptChallengeRule: …
exposed_credential_check: Optional[UnionMember4RuleJavaScriptChallengeRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember4RuleJavaScriptChallengeRuleRatelimit]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.
class UnionMember4RuleSetCacheControlRule: …
action_parameters: Optional[UnionMember4RuleSetCacheControlRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
immutable: Optional[UnionMember4RuleSetCacheControlRuleActionParametersImmutable]A cache-control directive configuration.
A cache-control directive configuration.
max_age: Optional[UnionMember4RuleSetCacheControlRuleActionParametersMaxAge]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: Optional[UnionMember4RuleSetCacheControlRuleActionParametersMustRevalidate]A cache-control directive configuration.
A cache-control directive configuration.
must_understand: Optional[UnionMember4RuleSetCacheControlRuleActionParametersMustUnderstand]A cache-control directive configuration.
A cache-control directive configuration.
no_cache: Optional[UnionMember4RuleSetCacheControlRuleActionParametersNoCache]A cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
class UnionMember4RuleSetCacheControlRuleActionParametersNoCacheSetDirective: …Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
no_store: Optional[UnionMember4RuleSetCacheControlRuleActionParametersNoStore]A cache-control directive configuration.
A cache-control directive configuration.
no_transform: Optional[UnionMember4RuleSetCacheControlRuleActionParametersNoTransform]A cache-control directive configuration.
A cache-control directive configuration.
private: Optional[UnionMember4RuleSetCacheControlRuleActionParametersPrivate]A cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
class UnionMember4RuleSetCacheControlRuleActionParametersPrivateSetDirective: …Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
proxy_revalidate: Optional[UnionMember4RuleSetCacheControlRuleActionParametersProxyRevalidate]A cache-control directive configuration.
A cache-control directive configuration.
public: Optional[UnionMember4RuleSetCacheControlRuleActionParametersPublic]A cache-control directive configuration.
A cache-control directive configuration.
s_maxage: Optional[UnionMember4RuleSetCacheControlRuleActionParametersSMaxage]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
stale_if_error: Optional[UnionMember4RuleSetCacheControlRuleActionParametersStaleIfError]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
stale_while_revalidate: Optional[UnionMember4RuleSetCacheControlRuleActionParametersStaleWhileRevalidate]A cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
exposed_credential_check: Optional[UnionMember4RuleSetCacheControlRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember4RuleSetCacheControlRuleRatelimit]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.
class UnionMember4RuleSetCacheTagsRule: …
action_parameters: Optional[UnionMember4RuleSetCacheTagsRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
class UnionMember4RuleSetCacheTagsRuleActionParametersAddCacheTagsValues: …Add cache tags using a list of values.
Add cache tags using a list of values.
class UnionMember4RuleSetCacheTagsRuleActionParametersAddCacheTagsExpression: …Add cache tags using an expression.
Add cache tags using an expression.
class UnionMember4RuleSetCacheTagsRuleActionParametersRemoveCacheTagsValues: …Remove cache tags using a list of values.
Remove cache tags using a list of values.
class UnionMember4RuleSetCacheTagsRuleActionParametersRemoveCacheTagsExpression: …Remove cache tags using an expression.
Remove cache tags using an expression.
class UnionMember4RuleSetCacheTagsRuleActionParametersSetCacheTagsValues: …Set cache tags using a list of values.
Set cache tags using a list of values.
exposed_credential_check: Optional[UnionMember4RuleSetCacheTagsRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember4RuleSetCacheTagsRuleRatelimit]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.
class UnionMember4RuleTransformResponseHTMLRule: …
action_parameters: Optional[UnionMember4RuleTransformResponseHTMLRuleActionParameters]The parameters configuring the rule’s action.
The parameters configuring the rule’s action.
exposed_credential_check: Optional[UnionMember4RuleTransformResponseHTMLRuleExposedCredentialCheck]Configuration for exposed credential checking.
Configuration for exposed credential checking.
ratelimit: Optional[UnionMember4RuleTransformResponseHTMLRuleRatelimit]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.
Get an account or zone entry point ruleset
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
phase = client.rulesets.phases.get(
ruleset_phase="http_request_firewall_custom",
account_id="account_id",
)
print(phase){
"errors": [
{
"message": "something bad happened",
"code": 10000,
"source": {
"pointer": "/rules/0/action"
}
}
],
"messages": [
{
"message": "something bad happened",
"code": 10000,
"source": {
"pointer": "/rules/0/action"
}
}
],
"result": {
"id": "2f2feab2026849078ba485f918791bdc",
"description": "A description for my ruleset.",
"kind": "root",
"last_updated": "2000-01-01T00:00:00Z",
"name": "My ruleset",
"phase": "http_request_firewall_custom",
"rules": [
{
"last_updated": "2000-01-01T00:00:00Z",
"version": "1",
"id": "id",
"action": "action",
"action_parameters": {
"response": {
"content": "{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}",
"content_type": "application/json",
"status_code": 400
}
},
"categories": [
"directory-traversal"
],
"description": "Block the request.",
"enabled": true,
"exposed_credential_check": {
"password_expression": "url_decode(http.request.body.form[\\\"password\\\"][0])",
"username_expression": "url_decode(http.request.body.form[\\\"username\\\"][0])"
},
"expression": "expression",
"logging": {
"enabled": true
},
"ratelimit": {
"characteristics": [
"cf.colo.id"
],
"period": 60,
"counting_expression": "http.request.body.raw eq \"abcd\"",
"mitigation_timeout": 600,
"requests_per_period": 1000,
"requests_to_origin": true,
"score_per_period": 400,
"score_response_header_name": "my-score"
},
"ref": "ref"
}
],
"version": "1"
},
"success": true
}Returns Examples
{
"errors": [
{
"message": "something bad happened",
"code": 10000,
"source": {
"pointer": "/rules/0/action"
}
}
],
"messages": [
{
"message": "something bad happened",
"code": 10000,
"source": {
"pointer": "/rules/0/action"
}
}
],
"result": {
"id": "2f2feab2026849078ba485f918791bdc",
"description": "A description for my ruleset.",
"kind": "root",
"last_updated": "2000-01-01T00:00:00Z",
"name": "My ruleset",
"phase": "http_request_firewall_custom",
"rules": [
{
"last_updated": "2000-01-01T00:00:00Z",
"version": "1",
"id": "id",
"action": "action",
"action_parameters": {
"response": {
"content": "{\n \"success\": false,\n \"error\": \"you have been blocked\"\n}",
"content_type": "application/json",
"status_code": 400
}
},
"categories": [
"directory-traversal"
],
"description": "Block the request.",
"enabled": true,
"exposed_credential_check": {
"password_expression": "url_decode(http.request.body.form[\\\"password\\\"][0])",
"username_expression": "url_decode(http.request.body.form[\\\"username\\\"][0])"
},
"expression": "expression",
"logging": {
"enabled": true
},
"ratelimit": {
"characteristics": [
"cf.colo.id"
],
"period": 60,
"counting_expression": "http.request.body.raw eq \"abcd\"",
"mitigation_timeout": 600,
"requests_per_period": 1000,
"requests_to_origin": true,
"score_per_period": 400,
"score_response_header_name": "my-score"
},
"ref": "ref"
}
],
"version": "1"
},
"success": true
}