Skip to content
Start here

Versions

List an account or zone ruleset's versions
GET/{accounts_or_zones}/{account_or_zone_id}/rulesets/{ruleset_id}/versions
Get an account or zone ruleset version
GET/{accounts_or_zones}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}
Delete an account or zone ruleset version
DELETE/{accounts_or_zones}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}
ModelsExpand Collapse
VersionListResponse object { id, kind, last_updated, 4 more }

A ruleset object.

id: string

The unique ID of the ruleset.

kind: Kind

The kind of the ruleset.

last_updated: string

The timestamp of when the ruleset was last modified.

formatdate-time
name: string

The human-readable name of the ruleset.

minLength1
phase: Phase

The phase of the ruleset.

version: string

The version of the ruleset.

description: optional string

An informative description of the ruleset.

VersionGetResponse object { id, kind, last_updated, 5 more }

A ruleset object.

id: string

The unique ID of the ruleset.

kind: Kind

The kind of the ruleset.

last_updated: string

The timestamp of when the ruleset was last modified.

formatdate-time
name: string

The human-readable name of the ruleset.

minLength1
phase: Phase

The phase of the ruleset.

rules: array of BlockRule { last_updated, version, id, 10 more } or object { id, action, enabled, 10 more } or CompressResponseRule { last_updated, version, id, 10 more } or 18 more

The list of rules in the ruleset.

One of the following:
BlockRule = BlockRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ChallengeRule object { id, action, enabled, 10 more }
id: string

The unique ID of the rule.

action: "challenge"

The action to perform when the rule matches.

enabled: boolean

Whether the rule should be executed.

expression: string

The expression defining which traffic will match the rule.

minLength1
last_updated: string

The timestamp of when the rule was last modified.

formatdate-time
ref: string

The reference of the rule (the rule’s ID by default).

minLength1
version: string

The version of the rule.

action_parameters: optional unknown

The parameters configuring the rule’s action.

categories: optional array of string

The categories of the rule.

description: optional string

An informative description of the rule.

exposed_credential_check: optional object { password_expression, username_expression }

Configuration for exposed credential checking.

password_expression: string

An expression that selects the password used in the credentials check.

minLength1
username_expression: string

An expression that selects the user ID used in the credentials check.

minLength1
logging: optional Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit: optional object { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: array of string

Characteristics of the request on which the rate limit counter will be incremented.

period: number

Period in seconds over which the counter is being incremented.

minimum0
counting_expression: optional string

An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.

minLength1
mitigation_timeout: optional number

Period of time in seconds after which the action will be disabled following its first execution.

requests_per_period: optional number

The threshold of requests per period after which the action will be executed for the first time.

minimum1
requests_to_origin: optional boolean

Whether counting is only performed when an origin is reached.

score_per_period: optional number

The score threshold per period for which the action will be executed the first time.

score_response_header_name: optional string

A response header name provided by the origin, which contains the score to increment rate limit counter with.

minLength1
ResponseCompressionRule = CompressResponseRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
DDoSDynamicRule = DDoSDynamicRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ExecuteRule = ExecuteRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ForceConnectionCloseRule = ForceConnectionCloseRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
JavaScriptChallengeRule object { id, action, enabled, 10 more }
id: string

The unique ID of the rule.

action: "js_challenge"

The action to perform when the rule matches.

enabled: boolean

Whether the rule should be executed.

expression: string

The expression defining which traffic will match the rule.

minLength1
last_updated: string

The timestamp of when the rule was last modified.

formatdate-time
ref: string

The reference of the rule (the rule’s ID by default).

minLength1
version: string

The version of the rule.

action_parameters: optional unknown

The parameters configuring the rule’s action.

categories: optional array of string

The categories of the rule.

description: optional string

An informative description of the rule.

exposed_credential_check: optional object { password_expression, username_expression }

Configuration for exposed credential checking.

password_expression: string

An expression that selects the password used in the credentials check.

minLength1
username_expression: string

An expression that selects the user ID used in the credentials check.

minLength1
logging: optional Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit: optional object { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: array of string

Characteristics of the request on which the rate limit counter will be incremented.

period: number

Period in seconds over which the counter is being incremented.

minimum0
counting_expression: optional string

An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.

minLength1
mitigation_timeout: optional number

Period of time in seconds after which the action will be disabled following its first execution.

requests_per_period: optional number

The threshold of requests per period after which the action will be executed for the first time.

minimum1
requests_to_origin: optional boolean

Whether counting is only performed when an origin is reached.

score_per_period: optional number

The score threshold per period for which the action will be executed the first time.

score_response_header_name: optional string

A response header name provided by the origin, which contains the score to increment rate limit counter with.

minLength1
LogRule = LogRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
LogCustomFieldRule = LogCustomFieldRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ManagedChallengeRule = ManagedChallengeRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RedirectRule = RedirectRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RewriteRule = RewriteRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RouteRule = RouteRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ScoreRule = ScoreRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ServeErrorRule = ServeErrorRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SetCacheControlRule object { id, action, enabled, 10 more }
id: string

The unique ID of the rule.

action: "set_cache_control"

The action to perform when the rule matches.

enabled: boolean
expression: string

The expression defining which traffic will match the rule.

minLength1
last_updated: string

The timestamp of when the rule was last modified.

formatdate-time
ref: string

The reference of the rule (the rule’s ID by default).

minLength1
version: string

The version of the rule.

action_parameters: optional object { immutable, "max-age", "must-revalidate", 10 more }

The parameters configuring the rule’s action.

immutable: optional object { operation, cloudflare_only } or object { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective object { operation, cloudflare_only }

Set the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

"max-age": optional object { operation, value, cloudflare_only } or object { operation, cloudflare_only }

A cache-control directive configuration that accepts a duration value in seconds.

One of the following:
SetDirective object { operation, value, cloudflare_only }

Set the directive with a duration value in seconds.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
value: number

The duration value in seconds for the directive.

minimum0
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

"must-revalidate": optional object { operation, cloudflare_only } or object { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective object { operation, cloudflare_only }

Set the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

"must-understand": optional object { operation, cloudflare_only } or object { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective object { operation, cloudflare_only }

Set the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

"no-cache": optional object { operation, cloudflare_only, qualifiers } or object { operation, cloudflare_only }

A cache-control directive configuration that accepts optional qualifiers (header names).

One of the following:
SetDirective object { operation, cloudflare_only, qualifiers }

Set the directive with optional qualifiers.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

qualifiers: optional array of string

Optional list of header names to qualify the directive (e.g., for “private” or “no-cache” directives).

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

"no-store": optional object { operation, cloudflare_only } or object { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective object { operation, cloudflare_only }

Set the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

"no-transform": optional object { operation, cloudflare_only } or object { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective object { operation, cloudflare_only }

Set the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

private: optional object { operation, cloudflare_only, qualifiers } or object { operation, cloudflare_only }

A cache-control directive configuration that accepts optional qualifiers (header names).

One of the following:
SetDirective object { operation, cloudflare_only, qualifiers }

Set the directive with optional qualifiers.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

qualifiers: optional array of string

Optional list of header names to qualify the directive (e.g., for “private” or “no-cache” directives).

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

"proxy-revalidate": optional object { operation, cloudflare_only } or object { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective object { operation, cloudflare_only }

Set the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

public: optional object { operation, cloudflare_only } or object { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective object { operation, cloudflare_only }

Set the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

"s-maxage": optional object { operation, value, cloudflare_only } or object { operation, cloudflare_only }

A cache-control directive configuration that accepts a duration value in seconds.

One of the following:
SetDirective object { operation, value, cloudflare_only }

Set the directive with a duration value in seconds.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
value: number

The duration value in seconds for the directive.

minimum0
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

"stale-if-error": optional object { operation, value, cloudflare_only } or object { operation, cloudflare_only }

A cache-control directive configuration that accepts a duration value in seconds.

One of the following:
SetDirective object { operation, value, cloudflare_only }

Set the directive with a duration value in seconds.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
value: number

The duration value in seconds for the directive.

minimum0
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

"stale-while-revalidate": optional object { operation, value, cloudflare_only } or object { operation, cloudflare_only }

A cache-control directive configuration that accepts a duration value in seconds.

One of the following:
SetDirective object { operation, value, cloudflare_only }

Set the directive with a duration value in seconds.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
value: number

The duration value in seconds for the directive.

minimum0
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

RemoveDirective object { operation, cloudflare_only }

Remove the directive.

operation: "set" or "remove"

The operation to perform on the cache-control directive.

One of the following:
"set"
"remove"
cloudflare_only: optional boolean

Whether the directive should only be applied to the Cloudflare CDN cache.

categories: optional array of string

The categories of the rule.

description: optional string

An informative description of the rule.

exposed_credential_check: optional object { password_expression, username_expression }

Configuration for exposed credential checking.

password_expression: string

An expression that selects the password used in the credentials check.

minLength1
username_expression: string

An expression that selects the user ID used in the credentials check.

minLength1
logging: optional Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit: optional object { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: array of string

Characteristics of the request on which the rate limit counter will be incremented.

period: number

Period in seconds over which the counter is being incremented.

minimum0
counting_expression: optional string

An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.

minLength1
mitigation_timeout: optional number

Period of time in seconds after which the action will be disabled following its first execution.

requests_per_period: optional number

The threshold of requests per period after which the action will be executed for the first time.

minimum1
requests_to_origin: optional boolean

Whether counting is only performed when an origin is reached.

score_per_period: optional number

The score threshold per period for which the action will be executed the first time.

score_response_header_name: optional string

A response header name provided by the origin, which contains the score to increment rate limit counter with.

minLength1
SetCacheSettingsRule = SetCacheSettingsRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SetCacheTagsRule object { id, action, enabled, 10 more }
id: string

The unique ID of the rule.

action: "set_cache_tags"

The action to perform when the rule matches.

enabled: boolean
expression: string

The expression defining which traffic will match the rule.

minLength1
last_updated: string

The timestamp of when the rule was last modified.

formatdate-time
ref: string

The reference of the rule (the rule’s ID by default).

minLength1
version: string

The version of the rule.

action_parameters: optional object { operation, values } or object { expression, operation } or object { operation, values } or 3 more

The parameters configuring the rule’s action.

One of the following:
AddCacheTagsValues object { operation, values }

Add cache tags using a list of values.

operation: "add" or "remove" or "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: array of string

A list of cache tag values.

AddCacheTagsExpression object { expression, operation }

Add cache tags using an expression.

expression: string

An expression that evaluates to an array of cache tag values.

minLength1
operation: "add" or "remove" or "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
RemoveCacheTagsValues object { operation, values }

Remove cache tags using a list of values.

operation: "add" or "remove" or "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: array of string

A list of cache tag values.

RemoveCacheTagsExpression object { expression, operation }

Remove cache tags using an expression.

expression: string

An expression that evaluates to an array of cache tag values.

minLength1
operation: "add" or "remove" or "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
SetCacheTagsValues object { operation, values }

Set cache tags using a list of values.

operation: "add" or "remove" or "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: array of string

A list of cache tag values.

SetCacheTagsExpression object { expression, operation }

Set cache tags using an expression.

expression: string

An expression that evaluates to an array of cache tag values.

minLength1
operation: "add" or "remove" or "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
categories: optional array of string

The categories of the rule.

description: optional string

An informative description of the rule.

exposed_credential_check: optional object { password_expression, username_expression }

Configuration for exposed credential checking.

password_expression: string

An expression that selects the password used in the credentials check.

minLength1
username_expression: string

An expression that selects the user ID used in the credentials check.

minLength1
logging: optional Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit: optional object { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: array of string

Characteristics of the request on which the rate limit counter will be incremented.

period: number

Period in seconds over which the counter is being incremented.

minimum0
counting_expression: optional string

An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.

minLength1
mitigation_timeout: optional number

Period of time in seconds after which the action will be disabled following its first execution.

requests_per_period: optional number

The threshold of requests per period after which the action will be executed for the first time.

minimum1
requests_to_origin: optional boolean

Whether counting is only performed when an origin is reached.

score_per_period: optional number

The score threshold per period for which the action will be executed the first time.

score_response_header_name: optional string

A response header name provided by the origin, which contains the score to increment rate limit counter with.

minLength1
SetConfigurationRule = SetConfigRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SkipRule = SkipRule { last_updated, version, id, 10 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
TransformResponseHTMLRule object { id, action, enabled, 10 more }
id: string

The unique ID of the rule.

action: "transform_response_html"

The action to perform when the rule matches.

enabled: boolean
expression: string

The expression defining which traffic will match the rule.

minLength1
last_updated: string

The timestamp of when the rule was last modified.

formatdate-time
ref: string

The reference of the rule (the rule’s ID by default).

minLength1
version: string

The version of the rule.

action_parameters: optional object { link_maze }

The parameters configuring the rule’s action.

categories: optional array of string

The categories of the rule.

description: optional string

An informative description of the rule.

exposed_credential_check: optional object { password_expression, username_expression }

Configuration for exposed credential checking.

password_expression: string

An expression that selects the password used in the credentials check.

minLength1
username_expression: string

An expression that selects the user ID used in the credentials check.

minLength1
logging: optional Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit: optional object { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: array of string

Characteristics of the request on which the rate limit counter will be incremented.

period: number

Period in seconds over which the counter is being incremented.

minimum0
counting_expression: optional string

An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.

minLength1
mitigation_timeout: optional number

Period of time in seconds after which the action will be disabled following its first execution.

requests_per_period: optional number

The threshold of requests per period after which the action will be executed for the first time.

minimum1
requests_to_origin: optional boolean

Whether counting is only performed when an origin is reached.

score_per_period: optional number

The score threshold per period for which the action will be executed the first time.

score_response_header_name: optional string

A response header name provided by the origin, which contains the score to increment rate limit counter with.

minLength1
version: string

The version of the ruleset.

description: optional string

An informative description of the ruleset.