Skip to content
Start here

Phases

Get an account or zone entry point ruleset
client.rulesets.phases.get(PhaserulesetPhase, PhaseGetParams { account_id, zone_id } params?, RequestOptionsoptions?): PhaseGetResponse { id, kind, last_updated, 5 more }
GET/{accounts_or_zones}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint
Update an account or zone entry point ruleset
client.rulesets.phases.update(PhaserulesetPhase, PhaseUpdateParams { account_id, zone_id, dry_run, 3 more } params, RequestOptionsoptions?): PhaseUpdateResponse
PUT/{accounts_or_zones}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint
ModelsExpand Collapse
PhaseGetResponse { 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<BlockRule { id, action, enabled, 2 more } | ChallengeRule { id, action, enabled, 10 more } | ResponseCompressionRule { id, action, enabled, 2 more } | 18 more>

The list of rules in the ruleset.

One of the following:
BlockRule extends BlockRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ChallengeRule { 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?: unknown

The parameters configuring the rule’s action.

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
ResponseCompressionRule extends CompressResponseRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
DDoSDynamicRule extends DDoSDynamicRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ExecuteRule extends ExecuteRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ForceConnectionCloseRule extends ForceConnectionCloseRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
JavaScriptChallengeRule { 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?: unknown

The parameters configuring the rule’s action.

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
LogRule extends LogRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
LogCustomFieldRule extends LogCustomFieldRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ManagedChallengeRule extends ManagedChallengeRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RedirectRule extends RedirectRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RewriteRule extends RewriteRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RouteRule extends RouteRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ScoreRule extends ScoreRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ServeErrorRule extends ServeErrorRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SetCacheControlRule { 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?: ActionParameters { immutable, max-age, must-revalidate, 10 more }

The parameters configuring the rule’s action.

immutable?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"max-age"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"must-revalidate"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"must-understand"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"no-cache"?: SetDirective { operation, cloudflare_only, qualifiers } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with optional qualifiers.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

qualifiers?: Array<string>

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"no-store"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"no-transform"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

private?: SetDirective { operation, cloudflare_only, qualifiers } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with optional qualifiers.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

qualifiers?: Array<string>

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"proxy-revalidate"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

public?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"s-maxage"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"stale-if-error"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"stale-while-revalidate"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
SetCacheSettingsRule extends SetCacheSettingsRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SetCacheTagsRule { 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?: AddCacheTagsValues { operation, values } | AddCacheTagsExpression { expression, operation } | RemoveCacheTagsValues { operation, values } | 3 more

The parameters configuring the rule’s action.

One of the following:
AddCacheTagsValues { operation, values }

Add cache tags using a list of values.

operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: Array<string>

A list of cache tag values.

AddCacheTagsExpression { expression, operation }

Add cache tags using an expression.

expression: string

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

minLength1
operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

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

Remove cache tags using a list of values.

operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: Array<string>

A list of cache tag values.

RemoveCacheTagsExpression { expression, operation }

Remove cache tags using an expression.

expression: string

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

minLength1
operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

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

Set cache tags using a list of values.

operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: Array<string>

A list of cache tag values.

SetCacheTagsExpression { expression, operation }

Set cache tags using an expression.

expression: string

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

minLength1
operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
SetConfigurationRule extends SetConfigRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SkipRule extends SkipRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
TransformResponseHTMLRule { 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?: ActionParameters { link_maze }

The parameters configuring the rule’s action.

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: 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?: string

An informative description of the ruleset.

PhaseUpdateResponse = Ruleset { id, kind, last_updated, 5 more } | unknown

A result.

One of the following:
Ruleset { 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<BlockRule { id, action, enabled, 2 more } | ChallengeRule { id, action, enabled, 10 more } | ResponseCompressionRule { id, action, enabled, 2 more } | 18 more>

The list of rules in the ruleset.

One of the following:
BlockRule extends BlockRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ChallengeRule { 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?: unknown

The parameters configuring the rule’s action.

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
ResponseCompressionRule extends CompressResponseRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
DDoSDynamicRule extends DDoSDynamicRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ExecuteRule extends ExecuteRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ForceConnectionCloseRule extends ForceConnectionCloseRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
JavaScriptChallengeRule { 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?: unknown

The parameters configuring the rule’s action.

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
LogRule extends LogRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
LogCustomFieldRule extends LogCustomFieldRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ManagedChallengeRule extends ManagedChallengeRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RedirectRule extends RedirectRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RewriteRule extends RewriteRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RouteRule extends RouteRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ScoreRule extends ScoreRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ServeErrorRule extends ServeErrorRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SetCacheControlRule { 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?: ActionParameters { immutable, max-age, must-revalidate, 10 more }

The parameters configuring the rule’s action.

immutable?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"max-age"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"must-revalidate"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"must-understand"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"no-cache"?: SetDirective { operation, cloudflare_only, qualifiers } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with optional qualifiers.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

qualifiers?: Array<string>

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"no-store"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"no-transform"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

private?: SetDirective { operation, cloudflare_only, qualifiers } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with optional qualifiers.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

qualifiers?: Array<string>

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"proxy-revalidate"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

public?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"s-maxage"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"stale-if-error"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"stale-while-revalidate"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
SetCacheSettingsRule extends SetCacheSettingsRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SetCacheTagsRule { 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?: AddCacheTagsValues { operation, values } | AddCacheTagsExpression { expression, operation } | RemoveCacheTagsValues { operation, values } | 3 more

The parameters configuring the rule’s action.

One of the following:
AddCacheTagsValues { operation, values }

Add cache tags using a list of values.

operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: Array<string>

A list of cache tag values.

AddCacheTagsExpression { expression, operation }

Add cache tags using an expression.

expression: string

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

minLength1
operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

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

Remove cache tags using a list of values.

operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: Array<string>

A list of cache tag values.

RemoveCacheTagsExpression { expression, operation }

Remove cache tags using an expression.

expression: string

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

minLength1
operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

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

Set cache tags using a list of values.

operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: Array<string>

A list of cache tag values.

SetCacheTagsExpression { expression, operation }

Set cache tags using an expression.

expression: string

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

minLength1
operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
SetConfigurationRule extends SetConfigRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SkipRule extends SkipRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
TransformResponseHTMLRule { 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?: ActionParameters { link_maze }

The parameters configuring the rule’s action.

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: 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?: string

An informative description of the ruleset.

unknown

PhasesVersions

List an account or zone entry point ruleset's versions
client.rulesets.phases.versions.list(PhaserulesetPhase, VersionListParams { account_id, zone_id } params?, RequestOptionsoptions?): SinglePage<VersionListResponse { id, kind, last_updated, 4 more } >
GET/{accounts_or_zones}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions
Get an account or zone entry point ruleset version
client.rulesets.phases.versions.get(stringrulesetVersion, VersionGetParams { ruleset_phase, account_id, zone_id } params, RequestOptionsoptions?): VersionGetResponse { id, kind, last_updated, 5 more }
GET/{accounts_or_zones}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint/versions/{ruleset_version}
ModelsExpand Collapse
VersionListResponse { 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?: string

An informative description of the ruleset.

VersionGetResponse { 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<BlockRule { id, action, enabled, 2 more } | ChallengeRule { id, action, enabled, 10 more } | ResponseCompressionRule { id, action, enabled, 2 more } | 18 more>

The list of rules in the ruleset.

One of the following:
BlockRule extends BlockRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ChallengeRule { 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?: unknown

The parameters configuring the rule’s action.

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
ResponseCompressionRule extends CompressResponseRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
DDoSDynamicRule extends DDoSDynamicRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ExecuteRule extends ExecuteRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ForceConnectionCloseRule extends ForceConnectionCloseRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
JavaScriptChallengeRule { 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?: unknown

The parameters configuring the rule’s action.

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
LogRule extends LogRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
LogCustomFieldRule extends LogCustomFieldRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ManagedChallengeRule extends ManagedChallengeRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RedirectRule extends RedirectRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RewriteRule extends RewriteRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
RouteRule extends RouteRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ScoreRule extends ScoreRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
ServeErrorRule extends ServeErrorRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SetCacheControlRule { 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?: ActionParameters { immutable, max-age, must-revalidate, 10 more }

The parameters configuring the rule’s action.

immutable?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"max-age"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"must-revalidate"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"must-understand"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"no-cache"?: SetDirective { operation, cloudflare_only, qualifiers } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with optional qualifiers.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

qualifiers?: Array<string>

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"no-store"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"no-transform"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

private?: SetDirective { operation, cloudflare_only, qualifiers } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with optional qualifiers.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

qualifiers?: Array<string>

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"proxy-revalidate"?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

public?: SetDirective { operation, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

A cache-control directive configuration.

One of the following:
SetDirective { operation, cloudflare_only }

Set the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"s-maxage"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"stale-if-error"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

"stale-while-revalidate"?: SetDirective { operation, value, cloudflare_only } | RemoveDirective { operation, cloudflare_only }

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

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

Set the directive with a duration value in seconds.

operation: "set" | "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?: boolean

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

RemoveDirective { operation, cloudflare_only }

Remove the directive.

operation: "set" | "remove"

The operation to perform on the cache-control directive.

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

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

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
SetCacheSettingsRule extends SetCacheSettingsRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SetCacheTagsRule { 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?: AddCacheTagsValues { operation, values } | AddCacheTagsExpression { expression, operation } | RemoveCacheTagsValues { operation, values } | 3 more

The parameters configuring the rule’s action.

One of the following:
AddCacheTagsValues { operation, values }

Add cache tags using a list of values.

operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: Array<string>

A list of cache tag values.

AddCacheTagsExpression { expression, operation }

Add cache tags using an expression.

expression: string

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

minLength1
operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

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

Remove cache tags using a list of values.

operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: Array<string>

A list of cache tag values.

RemoveCacheTagsExpression { expression, operation }

Remove cache tags using an expression.

expression: string

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

minLength1
operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

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

Set cache tags using a list of values.

operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
values: Array<string>

A list of cache tag values.

SetCacheTagsExpression { expression, operation }

Set cache tags using an expression.

expression: string

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

minLength1
operation: "add" | "remove" | "set"

The operation to perform on the cache tags.

One of the following:
"add"
"remove"
"set"
categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: string

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

minLength1
SetConfigurationRule extends SetConfigRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
SkipRule extends SkipRule { last_updated, version, id, 10 more } { id, action, enabled, 2 more }
id: string
action: string
enabled: boolean
expression: string
ref: string
TransformResponseHTMLRule { 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?: ActionParameters { link_maze }

The parameters configuring the rule’s action.

categories?: Array<string>

The categories of the rule.

description?: string

An informative description of the rule.

exposed_credential_check?: ExposedCredentialCheck { 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?: Logging { enabled }

An object configuring the rule’s logging behavior.

ratelimit?: Ratelimit { characteristics, period, counting_expression, 5 more }

An object configuring the rule’s rate limit behavior.

characteristics: Array<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?: 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?: number

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

requests_per_period?: number

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

minimum1
requests_to_origin?: boolean

Whether counting is only performed when an origin is reached.

score_per_period?: number

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

score_response_header_name?: 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?: string

An informative description of the ruleset.