Skip to content
Start here

Update an account or zone ruleset

client.Rulesets.Update(ctx, rulesetID, params) (*RulesetUpdateResponse, error)
PUT/{accounts_or_zones}/{account_or_zone_id}/rulesets/{ruleset_id}

Updates an account or zone ruleset, creating a new version.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Mass URL Redirects WriteMagic Firewall WriteL4 DDoS Managed Ruleset WriteTransform Rules WriteSelect Configuration WriteAccount WAF WriteAccount Rulesets WriteLogs Write
ParametersExpand Collapse
rulesetID string

The unique ID of the ruleset.

params RulesetUpdateParams
AccountID param.Field[string]optional

Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.

ZoneID param.Field[string]optional

Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

Description param.Field[string]optional

Body param: An informative description of the ruleset.

Kind param.Field[Kind]optional

Body param: The kind of the ruleset.

Name param.Field[string]optional

Body param: The human-readable name of the ruleset.

minLength1
Phase param.Field[Phase]optional

Body param: The phase of the ruleset.

Rules param.Field[[]RulesetUpdateParamsRule]optional

Body param: The list of rules in the ruleset.

type BlockRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action BlockRuleActionoptional

The action to perform when the rule matches.

ActionParameters BlockRuleActionParametersoptional

The parameters configuring the rule's action.

Response BlockRuleActionParametersResponseoptional

The response to show when the block is applied.

Content string

The content to return.

minLength1
ContentType string

The type of the content to return.

minLength1
StatusCode int64

The status code to return.

maximum499
minimum400
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck BlockRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit BlockRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RulesetUpdateParamsRulesRulesetsChallengeRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RulesetUpdateParamsRulesRulesetsChallengeRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RulesetUpdateParamsRulesRulesetsChallengeRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetUpdateParamsRulesRulesetsChallengeRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type CompressResponseRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action CompressResponseRuleActionoptional

The action to perform when the rule matches.

ActionParameters CompressResponseRuleActionParametersoptional

The parameters configuring the rule's action.

Algorithms []CompressResponseRuleActionParametersAlgorithm

Custom order for compression algorithms.

Name CompressResponseRuleActionParametersAlgorithmsNameoptional

Name of the compression algorithm to enable.

One of the following:
const CompressResponseRuleActionParametersAlgorithmsNameNone CompressResponseRuleActionParametersAlgorithmsName = "none"
const CompressResponseRuleActionParametersAlgorithmsNameAuto CompressResponseRuleActionParametersAlgorithmsName = "auto"
const CompressResponseRuleActionParametersAlgorithmsNameDefault CompressResponseRuleActionParametersAlgorithmsName = "default"
const CompressResponseRuleActionParametersAlgorithmsNameGzip CompressResponseRuleActionParametersAlgorithmsName = "gzip"
const CompressResponseRuleActionParametersAlgorithmsNameBrotli CompressResponseRuleActionParametersAlgorithmsName = "brotli"
const CompressResponseRuleActionParametersAlgorithmsNameZstd CompressResponseRuleActionParametersAlgorithmsName = "zstd"
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck CompressResponseRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit CompressResponseRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type DDoSDynamicRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action DDoSDynamicRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck DDoSDynamicRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit DDoSDynamicRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type ExecuteRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action ExecuteRuleActionoptional

The action to perform when the rule matches.

ActionParameters ExecuteRuleActionParametersoptional

The parameters configuring the rule's action.

ID string

The ID of the ruleset to execute.

MatchedData ExecuteRuleActionParametersMatchedDataoptional

The configuration to use for matched data logging.

PublicKey string

The public key to encrypt matched data logs with.

minLength1
Overrides ExecuteRuleActionParametersOverridesoptional

A set of overrides to apply to the target ruleset.

Action stringoptional

An action to override all rules with. This option has lower precedence than rule and category overrides.

Categories []ExecuteRuleActionParametersOverridesCategoryoptional

A list of category-level overrides. This option has the second-highest precedence after rule-level overrides.

Category string

The name of the category to override.

minLength1
Action stringoptional

The action to override rules in the category with.

Enabled booloptional

Whether to enable execution of rules in the category.

SensitivityLevel ExecuteRuleActionParametersOverridesCategoriesSensitivityLeveloptional

The sensitivity level to use for rules in the category. This option is only applicable for DDoS phases.

One of the following:
const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
Enabled booloptional

Whether to enable execution of all rules. This option has lower precedence than rule and category overrides.

Rules []ExecuteRuleActionParametersOverridesRuleoptional

A list of rule-level overrides. This option has the highest precedence.

ID string

The ID of the rule to override.

Action stringoptional

The action to override the rule with.

Enabled booloptional

Whether to enable execution of the rule.

ScoreThreshold int64optional

The score threshold to use for the rule.

SensitivityLevel ExecuteRuleActionParametersOverridesRulesSensitivityLeveloptional

The sensitivity level to use for the rule. This option is only applicable for DDoS phases.

One of the following:
const ExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
const ExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
const ExecuteRuleActionParametersOverridesRulesSensitivityLevelLow ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
const ExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
SensitivityLevel ExecuteRuleActionParametersOverridesSensitivityLeveloptional

A sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases.

One of the following:
const ExecuteRuleActionParametersOverridesSensitivityLevelDefault ExecuteRuleActionParametersOverridesSensitivityLevel = "default"
const ExecuteRuleActionParametersOverridesSensitivityLevelMedium ExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
const ExecuteRuleActionParametersOverridesSensitivityLevelLow ExecuteRuleActionParametersOverridesSensitivityLevel = "low"
const ExecuteRuleActionParametersOverridesSensitivityLevelEoff ExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck ExecuteRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit ExecuteRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type ForceConnectionCloseRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action ForceConnectionCloseRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck ForceConnectionCloseRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit ForceConnectionCloseRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RulesetUpdateParamsRulesRulesetsJSChallengeRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RulesetUpdateParamsRulesRulesetsJSChallengeRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RulesetUpdateParamsRulesRulesetsJSChallengeRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetUpdateParamsRulesRulesetsJSChallengeRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type LogRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action LogRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck LogRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit LogRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type LogCustomFieldRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action LogCustomFieldRuleActionoptional

The action to perform when the rule matches.

ActionParameters LogCustomFieldRuleActionParametersoptional

The parameters configuring the rule's action.

RawResponseFields []LogCustomFieldRuleActionParametersRawResponseFieldoptional

The raw response fields to log.

Name string

The name of the response header.

minLength1
PreserveDuplicates booloptional

Whether to log duplicate values of the same header.

RequestFields []LogCustomFieldRuleActionParametersRequestFieldoptional

The raw request fields to log.

Name string

The name of the header.

minLength1
ResponseFields []LogCustomFieldRuleActionParametersResponseFieldoptional

The transformed response fields to log.

Name string

The name of the response header.

minLength1
PreserveDuplicates booloptional

Whether to log duplicate values of the same header.

TransformedRequestFields []LogCustomFieldRuleActionParametersTransformedRequestFieldoptional

The transformed request fields to log.

Name string

The name of the header.

minLength1
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck LogCustomFieldRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit LogCustomFieldRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type ManagedChallengeRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action ManagedChallengeRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck ManagedChallengeRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit ManagedChallengeRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RedirectRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RedirectRuleActionoptional

The action to perform when the rule matches.

ActionParameters RedirectRuleActionParametersoptional

The parameters configuring the rule's action.

FromList RedirectRuleActionParametersFromListoptional

A redirect based on a bulk list lookup.

Key string

An expression that evaluates to the list lookup key.

minLength1
Name string

The name of the list to match against.

FromValue RedirectRuleActionParametersFromValueoptional

A redirect based on the request properties.

TargetURL RedirectRuleActionParametersFromValueTargetURL

A URL to redirect the request to.

Expression stringoptional

An expression that evaluates to a URL to redirect the request to.

minLength1
Value stringoptional

A URL to redirect the request to.

minLength1
PreserveQueryString booloptional

Whether to keep the query string of the original request.

StatusCode RedirectRuleActionParametersFromValueStatusCodeoptional

The status code to use for the redirect.

One of the following:
const RedirectRuleActionParametersFromValueStatusCode301 RedirectRuleActionParametersFromValueStatusCode = 301
const RedirectRuleActionParametersFromValueStatusCode302 RedirectRuleActionParametersFromValueStatusCode = 302
const RedirectRuleActionParametersFromValueStatusCode303 RedirectRuleActionParametersFromValueStatusCode = 303
const RedirectRuleActionParametersFromValueStatusCode307 RedirectRuleActionParametersFromValueStatusCode = 307
const RedirectRuleActionParametersFromValueStatusCode308 RedirectRuleActionParametersFromValueStatusCode = 308
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RedirectRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RedirectRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RewriteRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RewriteRuleActionoptional

The action to perform when the rule matches.

ActionParameters RewriteRuleActionParametersoptional

The parameters configuring the rule's action.

Headers map[string, RewriteRuleActionParametersHeader]optional

A map of headers to rewrite.

One of the following:
type RewriteRuleActionParametersHeadersAddStaticHeader struct{…}

A header with a static value to add.

Operation RewriteRuleActionParametersHeadersAddStaticHeaderOperation

The operation to perform on the header.

Value string

A static value for the header.

minLength1
type RewriteRuleActionParametersHeadersAddDynamicHeader struct{…}

A header with a dynamic value to add.

Expression string

An expression that evaluates to a value for the header.

minLength1
Operation RewriteRuleActionParametersHeadersAddDynamicHeaderOperation

The operation to perform on the header.

type RewriteRuleActionParametersHeadersSetStaticHeader struct{…}

A header with a static value to set.

Operation RewriteRuleActionParametersHeadersSetStaticHeaderOperation

The operation to perform on the header.

Value string

A static value for the header.

minLength1
type RewriteRuleActionParametersHeadersSetDynamicHeader struct{…}

A header with a dynamic value to set.

Expression string

An expression that evaluates to a value for the header.

minLength1
Operation RewriteRuleActionParametersHeadersSetDynamicHeaderOperation

The operation to perform on the header.

type RewriteRuleActionParametersHeadersRemoveHeader struct{…}

A header to remove.

Operation RewriteRuleActionParametersHeadersRemoveHeaderOperation

The operation to perform on the header.

URI RewriteRuleActionParametersURIoptional

A URI path rewrite.

One of the following:
type RewriteRuleActionParametersURIURIPath struct{…}

A URI path rewrite.

Path RewriteRuleActionParametersURIURIPathPath

A URI path rewrite.

Expression stringoptional

An expression that evaluates to a value to rewrite the URI path to.

minLength1
Value stringoptional

A value to rewrite the URI path to.

minLength1
Origin booloptional

Whether to propagate the rewritten URI to origin.

type RewriteRuleActionParametersURIURIQuery struct{…}

A URI query rewrite.

Query RewriteRuleActionParametersURIURIQueryQuery

A URI query rewrite.

Expression stringoptional

An expression that evaluates to a value to rewrite the URI query to.

minLength1
Value stringoptional

A value to rewrite the URI query to.

Origin booloptional

Whether to propagate the rewritten URI to origin.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RewriteRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RewriteRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RouteRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RouteRuleActionoptional

The action to perform when the rule matches.

ActionParameters RouteRuleActionParametersoptional

The parameters configuring the rule's action.

HostHeader stringoptional

A value to rewrite the HTTP host header to.

minLength1
Origin RouteRuleActionParametersOriginoptional

An origin to route to.

Host stringoptional

A resolved host to route to.

minLength1
Port int64optional

A destination port to route to.

maximum65535
minimum1
SNI RouteRuleActionParametersSNIoptional

A Server Name Indication (SNI) override.

Value string

A value to override the SNI to.

minLength1
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RouteRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RouteRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type ScoreRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action ScoreRuleActionoptional

The action to perform when the rule matches.

ActionParameters ScoreRuleActionParametersoptional

The parameters configuring the rule's action.

Increment int64

A delta to change the score by, which can be either positive or negative.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck ScoreRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit ScoreRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type ServeErrorRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action ServeErrorRuleActionoptional

The action to perform when the rule matches.

ActionParameters ServeErrorRuleActionParametersoptional

The parameters configuring the rule's action.

One of the following:
type ServeErrorRuleActionParametersActionParametersContent struct{…}
Content string

The response content.

minLength1
ContentType ServeErrorRuleActionParametersActionParametersContentContentTypeoptional

The content type header to set with the error response.

One of the following:
const ServeErrorRuleActionParametersActionParametersContentContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersContentContentType = "application/json"
const ServeErrorRuleActionParametersActionParametersContentContentTypeTextHTML ServeErrorRuleActionParametersActionParametersContentContentType = "text/html"
const ServeErrorRuleActionParametersActionParametersContentContentTypeTextPlain ServeErrorRuleActionParametersActionParametersContentContentType = "text/plain"
const ServeErrorRuleActionParametersActionParametersContentContentTypeTextXml ServeErrorRuleActionParametersActionParametersContentContentType = "text/xml"
StatusCode int64optional

The status code to use for the error.

maximum999
minimum400
type ServeErrorRuleActionParametersActionParametersAsset struct{…}
AssetName string

The name of a custom asset to serve as the error response.

minLength1
ContentType ServeErrorRuleActionParametersActionParametersAssetContentTypeoptional

The content type header to set with the error response.

One of the following:
const ServeErrorRuleActionParametersActionParametersAssetContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersAssetContentType = "application/json"
const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextHTML ServeErrorRuleActionParametersActionParametersAssetContentType = "text/html"
const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextPlain ServeErrorRuleActionParametersActionParametersAssetContentType = "text/plain"
const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextXml ServeErrorRuleActionParametersActionParametersAssetContentType = "text/xml"
StatusCode int64optional

The status code to use for the error.

maximum999
minimum400
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck ServeErrorRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit ServeErrorRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RulesetUpdateParamsRulesRulesetsSetCacheControlRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionoptional

The action to perform when the rule matches.

ActionParameters RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersoptional

The parameters configuring the rule's action.

Immutable RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirective struct{…}

Set the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MaxAge RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeoptional

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

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly booloptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MustRevalidate RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}

Set the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MustUnderstand RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}

Set the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoCache RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheoptional

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

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}

Set the directive with optional qualifiers.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Qualifiers []stringoptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoStore RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}

Set the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoTransform RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}

Set the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Private RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateoptional

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

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirective struct{…}

Set the directive with optional qualifiers.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Qualifiers []stringoptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

ProxyRevalidate RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}

Set the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Public RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirective struct{…}

Set the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

SMaxage RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageoptional

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

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly booloptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

StaleIfError RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErroroptional

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

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly booloptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

StaleWhileRevalidate RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateoptional

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

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly booloptional

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

type RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationSet RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "set"
const RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RulesetUpdateParamsRulesRulesetsSetCacheControlRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetUpdateParamsRulesRulesetsSetCacheControlRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type SetCacheSettingsRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action SetCacheSettingsRuleActionoptional

The action to perform when the rule matches.

ActionParameters SetCacheSettingsRuleActionParametersoptional

The parameters configuring the rule's action.

AdditionalCacheablePorts []int64optional

A list of additional ports that caching should be enabled on.

BrowserTTL SetCacheSettingsRuleActionParametersBrowserTTLoptional

How long client browsers should cache the response. Cloudflare cache purge will not purge content cached on client browsers, so high browser TTLs may lead to stale content.

Mode SetCacheSettingsRuleActionParametersBrowserTTLMode

The browser TTL mode.

One of the following:
const SetCacheSettingsRuleActionParametersBrowserTTLModeRespectOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "respect_origin"
const SetCacheSettingsRuleActionParametersBrowserTTLModeBypassByDefault SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass_by_default"
const SetCacheSettingsRuleActionParametersBrowserTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "override_origin"
const SetCacheSettingsRuleActionParametersBrowserTTLModeBypass SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass"
Default int64optional

The browser TTL (in seconds) if you choose the "override_origin" mode.

minimum0
Cache booloptional

Whether the request's response from the origin is eligible for caching. Caching itself will still depend on the cache control header and your other caching configurations.

CacheKey SetCacheSettingsRuleActionParametersCacheKeyoptional

Which components of the request are included in or excluded from the cache key Cloudflare uses to store the response in cache.

CacheByDeviceType booloptional

Whether to separate cached content based on the visitor's device type.

CacheDeceptionArmor booloptional

Whether to protect from web cache deception attacks, while allowing static assets to be cached.

CustomKey SetCacheSettingsRuleActionParametersCacheKeyCustomKeyoptional

Which components of the request are included or excluded from the cache key.

Header SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderoptional

Which headers to include in the cache key.

CheckPresence []stringoptional

A list of headers to check for the presence of. The presence of these headers is included in the cache key.

Contains map[string, []string]optional

A mapping of header names to a list of values. If a header is present in the request and contains any of the values provided, its value is included in the cache key.

ExcludeOrigin booloptional

Whether to exclude the origin header in the cache key.

Include []stringoptional

A list of headers to include in the cache key.

Host SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostoptional

How to use the host in the cache key.

Resolved booloptional

Whether to use the resolved host in the cache key.

QueryString SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringoptional

Which query string parameters to include in or exclude from the cache key.

Exclude SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeoptional

Which query string parameters to exclude from the cache key.

All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAlloptional

Whether to exclude all query string parameters from the cache key.

List []stringoptional

A list of query string parameters to exclude from the cache key.

Include SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeoptional

Which query string parameters to include in the cache key.

All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAlloptional

Whether to include all query string parameters in the cache key.

List []stringoptional

A list of query string parameters to include in the cache key.

User SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUseroptional

How to use characteristics of the request user agent in the cache key.

DeviceType booloptional

Whether to use the user agent's device type in the cache key.

Geo booloptional

Whether to use the user agents's country in the cache key.

Lang booloptional

Whether to use the user agent's language in the cache key.

IgnoreQueryStringsOrder booloptional

Whether to treat requests with the same query parameters the same, regardless of the order those query parameters are in.

CacheReserve SetCacheSettingsRuleActionParametersCacheReserveoptional

Settings to determine whether the request's response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan).

Eligible bool

Whether Cache Reserve is enabled. If this is true and a request meets eligibility criteria, Cloudflare will write the resource to Cache Reserve.

MinimumFileSize int64optional

The minimum file size eligible for storage in Cache Reserve.

minimum0
EdgeTTL SetCacheSettingsRuleActionParametersEdgeTTLoptional

How long the Cloudflare edge network should cache the response.

Mode SetCacheSettingsRuleActionParametersEdgeTTLMode

The edge TTL mode.

One of the following:
const SetCacheSettingsRuleActionParametersEdgeTTLModeRespectOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "respect_origin"
const SetCacheSettingsRuleActionParametersEdgeTTLModeBypassByDefault SetCacheSettingsRuleActionParametersEdgeTTLMode = "bypass_by_default"
const SetCacheSettingsRuleActionParametersEdgeTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "override_origin"
Default int64optional

The edge TTL (in seconds) if you choose the "override_origin" mode.

minimum0
StatusCodeTTL []SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLoptional

A list of TTLs to apply to specific status codes or status code ranges.

Value int64

The time to cache the response for (in seconds). A value of 0 is equivalent to setting the cache control header with the value "no-cache". A value of -1 is equivalent to setting the cache control header with the value of "no-store".

StatusCode int64optional

A single status code to apply the TTL to.

maximum999
minimum100
StatusCodeRange SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeoptional

A range of status codes to apply the TTL to.

From int64optional

The lower bound of the range.

maximum999
minimum100
To int64optional

The upper bound of the range.

maximum999
minimum100
OriginCacheControl booloptional

Whether Cloudflare will aim to strictly adhere to RFC 7234.

OriginErrorPagePassthru booloptional

Whether to generate Cloudflare error pages for issues from the origin server.

ReadTimeout int64optional

A timeout value between two successive read operations to use for your origin server. Historically, the timeout value between two read options from Cloudflare to an origin server is 100 seconds. If you are attempting to reduce HTTP 524 errors because of timeouts from an origin server, try increasing this timeout value.

maximum6000
minimum100
RespectStrongEtags booloptional

Whether Cloudflare should respect strong ETag (entity tag) headers. If false, Cloudflare converts strong ETag headers to weak ETag headers.

ServeStale SetCacheSettingsRuleActionParametersServeStaleoptional

When to serve stale content from cache.

DisableStaleWhileUpdating booloptional

Whether Cloudflare should disable serving stale content while getting the latest content from the origin.

SharedDictionary SetCacheSettingsRuleActionParametersSharedDictionaryoptional

Configuration for shared dictionary compression. When set, Cloudflare injects Use-As-Dictionary headers on matching cacheable responses.

MatchPattern string

URL pattern for the Use-As-Dictionary match field. This pattern specifies which URLs can use this response as a dictionary.

maxLength1024
minLength1
StripEtags booloptional

Whether to strip ETag headers from the origin response before caching.

StripLastModified booloptional

Whether to strip Last-Modified headers from the origin response before caching.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck SetCacheSettingsRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit SetCacheSettingsRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RulesetUpdateParamsRulesRulesetsSetCacheTagsRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionoptional

The action to perform when the rule matches.

ActionParameters RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersoptional

The parameters configuring the rule's action.

One of the following:
type RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}

Add cache tags using a list of values.

Operation RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationAdd RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "add"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "remove"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationSet RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}

Add cache tags using an expression.

Expression string

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

minLength1
Operation RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationAdd RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "add"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "remove"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationSet RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "set"
type RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}

Remove cache tags using a list of values.

Operation RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationAdd RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "add"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "remove"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationSet RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}

Remove cache tags using an expression.

Expression string

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

minLength1
Operation RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationAdd RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "add"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "remove"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationSet RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "set"
type RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}

Set cache tags using a list of values.

Operation RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationAdd RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "add"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "remove"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationSet RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}

Set cache tags using an expression.

Expression string

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

minLength1
Operation RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationAdd RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "add"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationRemove RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "remove"
const RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationSet RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "set"
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetUpdateParamsRulesRulesetsSetCacheTagsRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type SetConfigRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action SetConfigRuleActionoptional

The action to perform when the rule matches.

ActionParameters SetConfigRuleActionParametersoptional

The parameters configuring the rule's action.

AutomaticHTTPSRewrites booloptional

Whether to enable Automatic HTTPS Rewrites.

Autominify SetConfigRuleActionParametersAutominifyoptional

Which file extensions to minify automatically.

CSS booloptional

Whether to minify CSS files.

HTML booloptional

Whether to minify HTML files.

JS booloptional

Whether to minify JavaScript files.

BIC booloptional

Whether to enable Browser Integrity Check (BIC).

ContentConverter booloptional

Whether to enable content conversion (e.g., HTML to Markdown).

DeprecatedDisableApps SetConfigRuleActionParametersDisableAppsoptional
Cloudflare Apps are deprected.

Whether to disable Cloudflare Apps.

DisablePayPerCrawl SetConfigRuleActionParametersDisablePayPerCrawloptional

Whether to disable Pay Per Crawl.

DisableRUM SetConfigRuleActionParametersDisableRUMoptional

Whether to disable Real User Monitoring (RUM).

DisableZaraz SetConfigRuleActionParametersDisableZarazoptional

Whether to disable Zaraz.

EmailObfuscation booloptional

Whether to enable Email Obfuscation.

Fonts booloptional

Whether to enable Cloudflare Fonts.

DeprecatedMirage booloptional
Mirage is deprecated. More information at https://developers.cloudflare.com/speed/optimization/images/mirage/.

Whether to enable Mirage.

OpportunisticEncryption booloptional

Whether to enable Opportunistic Encryption.

Polish SetConfigRuleActionParametersPolishoptional

The Polish level to configure.

One of the following:
const SetConfigRuleActionParametersPolishOff SetConfigRuleActionParametersPolish = "off"
const SetConfigRuleActionParametersPolishLossless SetConfigRuleActionParametersPolish = "lossless"
const SetConfigRuleActionParametersPolishLossy SetConfigRuleActionParametersPolish = "lossy"
const SetConfigRuleActionParametersPolishWebP SetConfigRuleActionParametersPolish = "webp"
RedirectsForAITraining booloptional

Whether to redirect verified AI training crawlers to canonical URLs found in the HTML response.

RequestBodyBuffering SetConfigRuleActionParametersRequestBodyBufferingoptional

The request body buffering mode.

One of the following:
const SetConfigRuleActionParametersRequestBodyBufferingNone SetConfigRuleActionParametersRequestBodyBuffering = "none"
const SetConfigRuleActionParametersRequestBodyBufferingStandard SetConfigRuleActionParametersRequestBodyBuffering = "standard"
const SetConfigRuleActionParametersRequestBodyBufferingFull SetConfigRuleActionParametersRequestBodyBuffering = "full"
ResponseBodyBuffering SetConfigRuleActionParametersResponseBodyBufferingoptional

The response body buffering mode.

One of the following:
const SetConfigRuleActionParametersResponseBodyBufferingNone SetConfigRuleActionParametersResponseBodyBuffering = "none"
const SetConfigRuleActionParametersResponseBodyBufferingStandard SetConfigRuleActionParametersResponseBodyBuffering = "standard"
RocketLoader booloptional

Whether to enable Rocket Loader.

SecurityLevel SetConfigRuleActionParametersSecurityLeveloptional

The Security Level to configure.

One of the following:
const SetConfigRuleActionParametersSecurityLevelOff SetConfigRuleActionParametersSecurityLevel = "off"
const SetConfigRuleActionParametersSecurityLevelEssentiallyOff SetConfigRuleActionParametersSecurityLevel = "essentially_off"
const SetConfigRuleActionParametersSecurityLevelLow SetConfigRuleActionParametersSecurityLevel = "low"
const SetConfigRuleActionParametersSecurityLevelMedium SetConfigRuleActionParametersSecurityLevel = "medium"
const SetConfigRuleActionParametersSecurityLevelHigh SetConfigRuleActionParametersSecurityLevel = "high"
const SetConfigRuleActionParametersSecurityLevelUnderAttack SetConfigRuleActionParametersSecurityLevel = "under_attack"
ServerSideExcludes booloptional

Whether to enable Server-Side Excludes.

SSL SetConfigRuleActionParametersSSLoptional

The SSL level to configure.

One of the following:
const SetConfigRuleActionParametersSSLOff SetConfigRuleActionParametersSSL = "off"
const SetConfigRuleActionParametersSSLFlexible SetConfigRuleActionParametersSSL = "flexible"
const SetConfigRuleActionParametersSSLFull SetConfigRuleActionParametersSSL = "full"
const SetConfigRuleActionParametersSSLStrict SetConfigRuleActionParametersSSL = "strict"
const SetConfigRuleActionParametersSSLOriginPull SetConfigRuleActionParametersSSL = "origin_pull"
SXG booloptional

Whether to enable Signed Exchanges (SXG).

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck SetConfigRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit SetConfigRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type SkipRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action SkipRuleActionoptional

The action to perform when the rule matches.

ActionParameters SkipRuleActionParametersoptional

The parameters configuring the rule's action.

Phase SkipRuleActionParametersPhaseoptional

A phase to skip the execution of. This option is only compatible with the products option.

Phases []Phaseoptional

A list of phases to skip the execution of. This option is incompatible with the rulesets option.

One of the following:
const PhaseDDoSL4 Phase = "ddos_l4"
const PhaseDDoSL7 Phase = "ddos_l7"
const PhaseHTTPConfigSettings Phase = "http_config_settings"
const PhaseHTTPCustomErrors Phase = "http_custom_errors"
const PhaseHTTPLogCustomFields Phase = "http_log_custom_fields"
const PhaseHTTPRatelimit Phase = "http_ratelimit"
const PhaseHTTPRequestCacheSettings Phase = "http_request_cache_settings"
const PhaseHTTPRequestDynamicRedirect Phase = "http_request_dynamic_redirect"
const PhaseHTTPRequestFirewallCustom Phase = "http_request_firewall_custom"
const PhaseHTTPRequestFirewallManaged Phase = "http_request_firewall_managed"
const PhaseHTTPRequestLateTransform Phase = "http_request_late_transform"
const PhaseHTTPRequestOrigin Phase = "http_request_origin"
const PhaseHTTPRequestRedirect Phase = "http_request_redirect"
const PhaseHTTPRequestSanitize Phase = "http_request_sanitize"
const PhaseHTTPRequestSBFM Phase = "http_request_sbfm"
const PhaseHTTPRequestTransform Phase = "http_request_transform"
const PhaseHTTPResponseCacheSettings Phase = "http_response_cache_settings"
const PhaseHTTPResponseCompression Phase = "http_response_compression"
const PhaseHTTPResponseFirewallManaged Phase = "http_response_firewall_managed"
const PhaseHTTPResponseHeadersTransform Phase = "http_response_headers_transform"
const PhaseMagicTransit Phase = "magic_transit"
const PhaseMagicTransitIDsManaged Phase = "magic_transit_ids_managed"
const PhaseMagicTransitManaged Phase = "magic_transit_managed"
const PhaseMagicTransitRatelimit Phase = "magic_transit_ratelimit"
Products []SkipRuleActionParametersProductoptional

A list of legacy security products to skip the execution of.

One of the following:
const SkipRuleActionParametersProductBIC SkipRuleActionParametersProduct = "bic"
const SkipRuleActionParametersProductHot SkipRuleActionParametersProduct = "hot"
const SkipRuleActionParametersProductRateLimit SkipRuleActionParametersProduct = "rateLimit"
const SkipRuleActionParametersProductSecurityLevel SkipRuleActionParametersProduct = "securityLevel"
const SkipRuleActionParametersProductUABlock SkipRuleActionParametersProduct = "uaBlock"
const SkipRuleActionParametersProductWAF SkipRuleActionParametersProduct = "waf"
const SkipRuleActionParametersProductZoneLockdown SkipRuleActionParametersProduct = "zoneLockdown"
Rules map[string, []string]optional

A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the execution of. This option is incompatible with the ruleset option.

Ruleset SkipRuleActionParametersRulesetoptional

A ruleset to skip the execution of. This option is incompatible with the rulesets option.

Rulesets []stringoptional

A list of ruleset IDs to skip the execution of. This option is incompatible with the ruleset and phases options.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck SkipRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit SkipRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
ReturnsExpand Collapse
type RulesetUpdateResponse struct{…}

A ruleset object.

ID string

The unique ID of the ruleset.

Kind Kind

The kind of the ruleset.

One of the following:
const KindManaged Kind = "managed"
const KindCustom Kind = "custom"
const KindRoot Kind = "root"
const KindZone Kind = "zone"
LastUpdated Time

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.

One of the following:
const PhaseDDoSL4 Phase = "ddos_l4"
const PhaseDDoSL7 Phase = "ddos_l7"
const PhaseHTTPConfigSettings Phase = "http_config_settings"
const PhaseHTTPCustomErrors Phase = "http_custom_errors"
const PhaseHTTPLogCustomFields Phase = "http_log_custom_fields"
const PhaseHTTPRatelimit Phase = "http_ratelimit"
const PhaseHTTPRequestCacheSettings Phase = "http_request_cache_settings"
const PhaseHTTPRequestDynamicRedirect Phase = "http_request_dynamic_redirect"
const PhaseHTTPRequestFirewallCustom Phase = "http_request_firewall_custom"
const PhaseHTTPRequestFirewallManaged Phase = "http_request_firewall_managed"
const PhaseHTTPRequestLateTransform Phase = "http_request_late_transform"
const PhaseHTTPRequestOrigin Phase = "http_request_origin"
const PhaseHTTPRequestRedirect Phase = "http_request_redirect"
const PhaseHTTPRequestSanitize Phase = "http_request_sanitize"
const PhaseHTTPRequestSBFM Phase = "http_request_sbfm"
const PhaseHTTPRequestTransform Phase = "http_request_transform"
const PhaseHTTPResponseCacheSettings Phase = "http_response_cache_settings"
const PhaseHTTPResponseCompression Phase = "http_response_compression"
const PhaseHTTPResponseFirewallManaged Phase = "http_response_firewall_managed"
const PhaseHTTPResponseHeadersTransform Phase = "http_response_headers_transform"
const PhaseMagicTransit Phase = "magic_transit"
const PhaseMagicTransitIDsManaged Phase = "magic_transit_ids_managed"
const PhaseMagicTransitManaged Phase = "magic_transit_managed"
const PhaseMagicTransitRatelimit Phase = "magic_transit_ratelimit"
Rules []RulesetUpdateResponseRule

The list of rules in the ruleset.

One of the following:
type BlockRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action BlockRuleActionoptional

The action to perform when the rule matches.

ActionParameters BlockRuleActionParametersoptional

The parameters configuring the rule's action.

Response BlockRuleActionParametersResponseoptional

The response to show when the block is applied.

Content string

The content to return.

minLength1
ContentType string

The type of the content to return.

minLength1
StatusCode int64

The status code to return.

maximum499
minimum400
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck BlockRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit BlockRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RulesetUpdateResponseRulesRulesetsChallengeRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RulesetUpdateResponseRulesRulesetsChallengeRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RulesetUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetUpdateResponseRulesRulesetsChallengeRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type CompressResponseRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action CompressResponseRuleActionoptional

The action to perform when the rule matches.

ActionParameters CompressResponseRuleActionParametersoptional

The parameters configuring the rule's action.

Algorithms []CompressResponseRuleActionParametersAlgorithm

Custom order for compression algorithms.

Name CompressResponseRuleActionParametersAlgorithmsNameoptional

Name of the compression algorithm to enable.

One of the following:
const CompressResponseRuleActionParametersAlgorithmsNameNone CompressResponseRuleActionParametersAlgorithmsName = "none"
const CompressResponseRuleActionParametersAlgorithmsNameAuto CompressResponseRuleActionParametersAlgorithmsName = "auto"
const CompressResponseRuleActionParametersAlgorithmsNameDefault CompressResponseRuleActionParametersAlgorithmsName = "default"
const CompressResponseRuleActionParametersAlgorithmsNameGzip CompressResponseRuleActionParametersAlgorithmsName = "gzip"
const CompressResponseRuleActionParametersAlgorithmsNameBrotli CompressResponseRuleActionParametersAlgorithmsName = "brotli"
const CompressResponseRuleActionParametersAlgorithmsNameZstd CompressResponseRuleActionParametersAlgorithmsName = "zstd"
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck CompressResponseRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit CompressResponseRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type DDoSDynamicRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action DDoSDynamicRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck DDoSDynamicRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit DDoSDynamicRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type ExecuteRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action ExecuteRuleActionoptional

The action to perform when the rule matches.

ActionParameters ExecuteRuleActionParametersoptional

The parameters configuring the rule's action.

ID string

The ID of the ruleset to execute.

MatchedData ExecuteRuleActionParametersMatchedDataoptional

The configuration to use for matched data logging.

PublicKey string

The public key to encrypt matched data logs with.

minLength1
Overrides ExecuteRuleActionParametersOverridesoptional

A set of overrides to apply to the target ruleset.

Action stringoptional

An action to override all rules with. This option has lower precedence than rule and category overrides.

Categories []ExecuteRuleActionParametersOverridesCategoryoptional

A list of category-level overrides. This option has the second-highest precedence after rule-level overrides.

Category string

The name of the category to override.

minLength1
Action stringoptional

The action to override rules in the category with.

Enabled booloptional

Whether to enable execution of rules in the category.

SensitivityLevel ExecuteRuleActionParametersOverridesCategoriesSensitivityLeveloptional

The sensitivity level to use for rules in the category. This option is only applicable for DDoS phases.

One of the following:
const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelDefault ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "default"
const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelMedium ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "medium"
const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelLow ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "low"
const ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelEoff ExecuteRuleActionParametersOverridesCategoriesSensitivityLevel = "eoff"
Enabled booloptional

Whether to enable execution of all rules. This option has lower precedence than rule and category overrides.

Rules []ExecuteRuleActionParametersOverridesRuleoptional

A list of rule-level overrides. This option has the highest precedence.

ID string

The ID of the rule to override.

Action stringoptional

The action to override the rule with.

Enabled booloptional

Whether to enable execution of the rule.

ScoreThreshold int64optional

The score threshold to use for the rule.

SensitivityLevel ExecuteRuleActionParametersOverridesRulesSensitivityLeveloptional

The sensitivity level to use for the rule. This option is only applicable for DDoS phases.

One of the following:
const ExecuteRuleActionParametersOverridesRulesSensitivityLevelDefault ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "default"
const ExecuteRuleActionParametersOverridesRulesSensitivityLevelMedium ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "medium"
const ExecuteRuleActionParametersOverridesRulesSensitivityLevelLow ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "low"
const ExecuteRuleActionParametersOverridesRulesSensitivityLevelEoff ExecuteRuleActionParametersOverridesRulesSensitivityLevel = "eoff"
SensitivityLevel ExecuteRuleActionParametersOverridesSensitivityLeveloptional

A sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases.

One of the following:
const ExecuteRuleActionParametersOverridesSensitivityLevelDefault ExecuteRuleActionParametersOverridesSensitivityLevel = "default"
const ExecuteRuleActionParametersOverridesSensitivityLevelMedium ExecuteRuleActionParametersOverridesSensitivityLevel = "medium"
const ExecuteRuleActionParametersOverridesSensitivityLevelLow ExecuteRuleActionParametersOverridesSensitivityLevel = "low"
const ExecuteRuleActionParametersOverridesSensitivityLevelEoff ExecuteRuleActionParametersOverridesSensitivityLevel = "eoff"
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck ExecuteRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit ExecuteRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type ForceConnectionCloseRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action ForceConnectionCloseRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck ForceConnectionCloseRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit ForceConnectionCloseRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RulesetUpdateResponseRulesRulesetsJSChallengeRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RulesetUpdateResponseRulesRulesetsJSChallengeRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RulesetUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetUpdateResponseRulesRulesetsJSChallengeRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type LogRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action LogRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck LogRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit LogRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type LogCustomFieldRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action LogCustomFieldRuleActionoptional

The action to perform when the rule matches.

ActionParameters LogCustomFieldRuleActionParametersoptional

The parameters configuring the rule's action.

RawResponseFields []LogCustomFieldRuleActionParametersRawResponseFieldoptional

The raw response fields to log.

Name string

The name of the response header.

minLength1
PreserveDuplicates booloptional

Whether to log duplicate values of the same header.

RequestFields []LogCustomFieldRuleActionParametersRequestFieldoptional

The raw request fields to log.

Name string

The name of the header.

minLength1
ResponseFields []LogCustomFieldRuleActionParametersResponseFieldoptional

The transformed response fields to log.

Name string

The name of the response header.

minLength1
PreserveDuplicates booloptional

Whether to log duplicate values of the same header.

TransformedRequestFields []LogCustomFieldRuleActionParametersTransformedRequestFieldoptional

The transformed request fields to log.

Name string

The name of the header.

minLength1
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck LogCustomFieldRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit LogCustomFieldRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type ManagedChallengeRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action ManagedChallengeRuleActionoptional

The action to perform when the rule matches.

ActionParameters unknownoptional

The parameters configuring the rule's action.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck ManagedChallengeRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit ManagedChallengeRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RedirectRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RedirectRuleActionoptional

The action to perform when the rule matches.

ActionParameters RedirectRuleActionParametersoptional

The parameters configuring the rule's action.

FromList RedirectRuleActionParametersFromListoptional

A redirect based on a bulk list lookup.

Key string

An expression that evaluates to the list lookup key.

minLength1
Name string

The name of the list to match against.

FromValue RedirectRuleActionParametersFromValueoptional

A redirect based on the request properties.

TargetURL RedirectRuleActionParametersFromValueTargetURL

A URL to redirect the request to.

Expression stringoptional

An expression that evaluates to a URL to redirect the request to.

minLength1
Value stringoptional

A URL to redirect the request to.

minLength1
PreserveQueryString booloptional

Whether to keep the query string of the original request.

StatusCode RedirectRuleActionParametersFromValueStatusCodeoptional

The status code to use for the redirect.

One of the following:
const RedirectRuleActionParametersFromValueStatusCode301 RedirectRuleActionParametersFromValueStatusCode = 301
const RedirectRuleActionParametersFromValueStatusCode302 RedirectRuleActionParametersFromValueStatusCode = 302
const RedirectRuleActionParametersFromValueStatusCode303 RedirectRuleActionParametersFromValueStatusCode = 303
const RedirectRuleActionParametersFromValueStatusCode307 RedirectRuleActionParametersFromValueStatusCode = 307
const RedirectRuleActionParametersFromValueStatusCode308 RedirectRuleActionParametersFromValueStatusCode = 308
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RedirectRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RedirectRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RewriteRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RewriteRuleActionoptional

The action to perform when the rule matches.

ActionParameters RewriteRuleActionParametersoptional

The parameters configuring the rule's action.

Headers map[string, RewriteRuleActionParametersHeader]optional

A map of headers to rewrite.

One of the following:
type RewriteRuleActionParametersHeadersAddStaticHeader struct{…}

A header with a static value to add.

Operation RewriteRuleActionParametersHeadersAddStaticHeaderOperation

The operation to perform on the header.

Value string

A static value for the header.

minLength1
type RewriteRuleActionParametersHeadersAddDynamicHeader struct{…}

A header with a dynamic value to add.

Expression string

An expression that evaluates to a value for the header.

minLength1
Operation RewriteRuleActionParametersHeadersAddDynamicHeaderOperation

The operation to perform on the header.

type RewriteRuleActionParametersHeadersSetStaticHeader struct{…}

A header with a static value to set.

Operation RewriteRuleActionParametersHeadersSetStaticHeaderOperation

The operation to perform on the header.

Value string

A static value for the header.

minLength1
type RewriteRuleActionParametersHeadersSetDynamicHeader struct{…}

A header with a dynamic value to set.

Expression string

An expression that evaluates to a value for the header.

minLength1
Operation RewriteRuleActionParametersHeadersSetDynamicHeaderOperation

The operation to perform on the header.

type RewriteRuleActionParametersHeadersRemoveHeader struct{…}

A header to remove.

Operation RewriteRuleActionParametersHeadersRemoveHeaderOperation

The operation to perform on the header.

URI RewriteRuleActionParametersURIoptional

A URI path rewrite.

One of the following:
type RewriteRuleActionParametersURIURIPath struct{…}

A URI path rewrite.

Path RewriteRuleActionParametersURIURIPathPath

A URI path rewrite.

Expression stringoptional

An expression that evaluates to a value to rewrite the URI path to.

minLength1
Value stringoptional

A value to rewrite the URI path to.

minLength1
Origin booloptional

Whether to propagate the rewritten URI to origin.

type RewriteRuleActionParametersURIURIQuery struct{…}

A URI query rewrite.

Query RewriteRuleActionParametersURIURIQueryQuery

A URI query rewrite.

Expression stringoptional

An expression that evaluates to a value to rewrite the URI query to.

minLength1
Value stringoptional

A value to rewrite the URI query to.

Origin booloptional

Whether to propagate the rewritten URI to origin.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RewriteRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RewriteRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RouteRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RouteRuleActionoptional

The action to perform when the rule matches.

ActionParameters RouteRuleActionParametersoptional

The parameters configuring the rule's action.

HostHeader stringoptional

A value to rewrite the HTTP host header to.

minLength1
Origin RouteRuleActionParametersOriginoptional

An origin to route to.

Host stringoptional

A resolved host to route to.

minLength1
Port int64optional

A destination port to route to.

maximum65535
minimum1
SNI RouteRuleActionParametersSNIoptional

A Server Name Indication (SNI) override.

Value string

A value to override the SNI to.

minLength1
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RouteRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RouteRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type ScoreRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action ScoreRuleActionoptional

The action to perform when the rule matches.

ActionParameters ScoreRuleActionParametersoptional

The parameters configuring the rule's action.

Increment int64

A delta to change the score by, which can be either positive or negative.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck ScoreRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit ScoreRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type ServeErrorRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action ServeErrorRuleActionoptional

The action to perform when the rule matches.

ActionParameters ServeErrorRuleActionParametersoptional

The parameters configuring the rule's action.

One of the following:
type ServeErrorRuleActionParametersActionParametersContent struct{…}
Content string

The response content.

minLength1
ContentType ServeErrorRuleActionParametersActionParametersContentContentTypeoptional

The content type header to set with the error response.

One of the following:
const ServeErrorRuleActionParametersActionParametersContentContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersContentContentType = "application/json"
const ServeErrorRuleActionParametersActionParametersContentContentTypeTextHTML ServeErrorRuleActionParametersActionParametersContentContentType = "text/html"
const ServeErrorRuleActionParametersActionParametersContentContentTypeTextPlain ServeErrorRuleActionParametersActionParametersContentContentType = "text/plain"
const ServeErrorRuleActionParametersActionParametersContentContentTypeTextXml ServeErrorRuleActionParametersActionParametersContentContentType = "text/xml"
StatusCode int64optional

The status code to use for the error.

maximum999
minimum400
type ServeErrorRuleActionParametersActionParametersAsset struct{…}
AssetName string

The name of a custom asset to serve as the error response.

minLength1
ContentType ServeErrorRuleActionParametersActionParametersAssetContentTypeoptional

The content type header to set with the error response.

One of the following:
const ServeErrorRuleActionParametersActionParametersAssetContentTypeApplicationJson ServeErrorRuleActionParametersActionParametersAssetContentType = "application/json"
const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextHTML ServeErrorRuleActionParametersActionParametersAssetContentType = "text/html"
const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextPlain ServeErrorRuleActionParametersActionParametersAssetContentType = "text/plain"
const ServeErrorRuleActionParametersActionParametersAssetContentTypeTextXml ServeErrorRuleActionParametersActionParametersAssetContentType = "text/xml"
StatusCode int64optional

The status code to use for the error.

maximum999
minimum400
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck ServeErrorRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit ServeErrorRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RulesetUpdateResponseRulesRulesetsSetCacheControlRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionoptional

The action to perform when the rule matches.

ActionParameters RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersoptional

The parameters configuring the rule's action.

Immutable RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirective struct{…}

Set the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MaxAge RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeoptional

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

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly booloptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MustRevalidate RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}

Set the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MustUnderstand RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}

Set the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoCache RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheoptional

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

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}

Set the directive with optional qualifiers.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Qualifiers []stringoptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoStore RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}

Set the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoTransform RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}

Set the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Private RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateoptional

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

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirective struct{…}

Set the directive with optional qualifiers.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Qualifiers []stringoptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

ProxyRevalidate RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}

Set the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Public RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicoptional

A cache-control directive configuration.

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirective struct{…}

Set the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

SMaxage RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageoptional

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

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly booloptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

StaleIfError RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErroroptional

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

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly booloptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

StaleWhileRevalidate RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateoptional

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

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly booloptional

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

type RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}

Remove the directive.

Operation RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationSet RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "set"
const RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RulesetUpdateResponseRulesRulesetsSetCacheControlRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetUpdateResponseRulesRulesetsSetCacheControlRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type SetCacheSettingsRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action SetCacheSettingsRuleActionoptional

The action to perform when the rule matches.

ActionParameters SetCacheSettingsRuleActionParametersoptional

The parameters configuring the rule's action.

AdditionalCacheablePorts []int64optional

A list of additional ports that caching should be enabled on.

BrowserTTL SetCacheSettingsRuleActionParametersBrowserTTLoptional

How long client browsers should cache the response. Cloudflare cache purge will not purge content cached on client browsers, so high browser TTLs may lead to stale content.

Mode SetCacheSettingsRuleActionParametersBrowserTTLMode

The browser TTL mode.

One of the following:
const SetCacheSettingsRuleActionParametersBrowserTTLModeRespectOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "respect_origin"
const SetCacheSettingsRuleActionParametersBrowserTTLModeBypassByDefault SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass_by_default"
const SetCacheSettingsRuleActionParametersBrowserTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersBrowserTTLMode = "override_origin"
const SetCacheSettingsRuleActionParametersBrowserTTLModeBypass SetCacheSettingsRuleActionParametersBrowserTTLMode = "bypass"
Default int64optional

The browser TTL (in seconds) if you choose the "override_origin" mode.

minimum0
Cache booloptional

Whether the request's response from the origin is eligible for caching. Caching itself will still depend on the cache control header and your other caching configurations.

CacheKey SetCacheSettingsRuleActionParametersCacheKeyoptional

Which components of the request are included in or excluded from the cache key Cloudflare uses to store the response in cache.

CacheByDeviceType booloptional

Whether to separate cached content based on the visitor's device type.

CacheDeceptionArmor booloptional

Whether to protect from web cache deception attacks, while allowing static assets to be cached.

CustomKey SetCacheSettingsRuleActionParametersCacheKeyCustomKeyoptional

Which components of the request are included or excluded from the cache key.

Header SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderoptional

Which headers to include in the cache key.

CheckPresence []stringoptional

A list of headers to check for the presence of. The presence of these headers is included in the cache key.

Contains map[string, []string]optional

A mapping of header names to a list of values. If a header is present in the request and contains any of the values provided, its value is included in the cache key.

ExcludeOrigin booloptional

Whether to exclude the origin header in the cache key.

Include []stringoptional

A list of headers to include in the cache key.

Host SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostoptional

How to use the host in the cache key.

Resolved booloptional

Whether to use the resolved host in the cache key.

QueryString SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringoptional

Which query string parameters to include in or exclude from the cache key.

Exclude SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeoptional

Which query string parameters to exclude from the cache key.

All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludeAlloptional

Whether to exclude all query string parameters from the cache key.

List []stringoptional

A list of query string parameters to exclude from the cache key.

Include SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeoptional

Which query string parameters to include in the cache key.

All SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludeAlloptional

Whether to include all query string parameters in the cache key.

List []stringoptional

A list of query string parameters to include in the cache key.

User SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUseroptional

How to use characteristics of the request user agent in the cache key.

DeviceType booloptional

Whether to use the user agent's device type in the cache key.

Geo booloptional

Whether to use the user agents's country in the cache key.

Lang booloptional

Whether to use the user agent's language in the cache key.

IgnoreQueryStringsOrder booloptional

Whether to treat requests with the same query parameters the same, regardless of the order those query parameters are in.

CacheReserve SetCacheSettingsRuleActionParametersCacheReserveoptional

Settings to determine whether the request's response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan).

Eligible bool

Whether Cache Reserve is enabled. If this is true and a request meets eligibility criteria, Cloudflare will write the resource to Cache Reserve.

MinimumFileSize int64optional

The minimum file size eligible for storage in Cache Reserve.

minimum0
EdgeTTL SetCacheSettingsRuleActionParametersEdgeTTLoptional

How long the Cloudflare edge network should cache the response.

Mode SetCacheSettingsRuleActionParametersEdgeTTLMode

The edge TTL mode.

One of the following:
const SetCacheSettingsRuleActionParametersEdgeTTLModeRespectOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "respect_origin"
const SetCacheSettingsRuleActionParametersEdgeTTLModeBypassByDefault SetCacheSettingsRuleActionParametersEdgeTTLMode = "bypass_by_default"
const SetCacheSettingsRuleActionParametersEdgeTTLModeOverrideOrigin SetCacheSettingsRuleActionParametersEdgeTTLMode = "override_origin"
Default int64optional

The edge TTL (in seconds) if you choose the "override_origin" mode.

minimum0
StatusCodeTTL []SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLoptional

A list of TTLs to apply to specific status codes or status code ranges.

Value int64

The time to cache the response for (in seconds). A value of 0 is equivalent to setting the cache control header with the value "no-cache". A value of -1 is equivalent to setting the cache control header with the value of "no-store".

StatusCode int64optional

A single status code to apply the TTL to.

maximum999
minimum100
StatusCodeRange SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRangeoptional

A range of status codes to apply the TTL to.

From int64optional

The lower bound of the range.

maximum999
minimum100
To int64optional

The upper bound of the range.

maximum999
minimum100
OriginCacheControl booloptional

Whether Cloudflare will aim to strictly adhere to RFC 7234.

OriginErrorPagePassthru booloptional

Whether to generate Cloudflare error pages for issues from the origin server.

ReadTimeout int64optional

A timeout value between two successive read operations to use for your origin server. Historically, the timeout value between two read options from Cloudflare to an origin server is 100 seconds. If you are attempting to reduce HTTP 524 errors because of timeouts from an origin server, try increasing this timeout value.

maximum6000
minimum100
RespectStrongEtags booloptional

Whether Cloudflare should respect strong ETag (entity tag) headers. If false, Cloudflare converts strong ETag headers to weak ETag headers.

ServeStale SetCacheSettingsRuleActionParametersServeStaleoptional

When to serve stale content from cache.

DisableStaleWhileUpdating booloptional

Whether Cloudflare should disable serving stale content while getting the latest content from the origin.

SharedDictionary SetCacheSettingsRuleActionParametersSharedDictionaryoptional

Configuration for shared dictionary compression. When set, Cloudflare injects Use-As-Dictionary headers on matching cacheable responses.

MatchPattern string

URL pattern for the Use-As-Dictionary match field. This pattern specifies which URLs can use this response as a dictionary.

maxLength1024
minLength1
StripEtags booloptional

Whether to strip ETag headers from the origin response before caching.

StripLastModified booloptional

Whether to strip Last-Modified headers from the origin response before caching.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck SetCacheSettingsRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit SetCacheSettingsRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type RulesetUpdateResponseRulesRulesetsSetCacheTagsRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionoptional

The action to perform when the rule matches.

ActionParameters RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersoptional

The parameters configuring the rule's action.

One of the following:
type RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}

Add cache tags using a list of values.

Operation RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationAdd RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "add"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "remove"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationSet RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}

Add cache tags using an expression.

Expression string

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

minLength1
Operation RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationAdd RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "add"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "remove"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationSet RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "set"
type RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}

Remove cache tags using a list of values.

Operation RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationAdd RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "add"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "remove"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationSet RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}

Remove cache tags using an expression.

Expression string

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

minLength1
Operation RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationAdd RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "add"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "remove"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationSet RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "set"
type RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}

Set cache tags using a list of values.

Operation RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationAdd RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "add"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "remove"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationSet RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}

Set cache tags using an expression.

Expression string

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

minLength1
Operation RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationAdd RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "add"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationRemove RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "remove"
const RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationSet RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "set"
Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetUpdateResponseRulesRulesetsSetCacheTagsRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type SetConfigRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action SetConfigRuleActionoptional

The action to perform when the rule matches.

ActionParameters SetConfigRuleActionParametersoptional

The parameters configuring the rule's action.

AutomaticHTTPSRewrites booloptional

Whether to enable Automatic HTTPS Rewrites.

Autominify SetConfigRuleActionParametersAutominifyoptional

Which file extensions to minify automatically.

CSS booloptional

Whether to minify CSS files.

HTML booloptional

Whether to minify HTML files.

JS booloptional

Whether to minify JavaScript files.

BIC booloptional

Whether to enable Browser Integrity Check (BIC).

ContentConverter booloptional

Whether to enable content conversion (e.g., HTML to Markdown).

DeprecatedDisableApps SetConfigRuleActionParametersDisableAppsoptional
Cloudflare Apps are deprected.

Whether to disable Cloudflare Apps.

DisablePayPerCrawl SetConfigRuleActionParametersDisablePayPerCrawloptional

Whether to disable Pay Per Crawl.

DisableRUM SetConfigRuleActionParametersDisableRUMoptional

Whether to disable Real User Monitoring (RUM).

DisableZaraz SetConfigRuleActionParametersDisableZarazoptional

Whether to disable Zaraz.

EmailObfuscation booloptional

Whether to enable Email Obfuscation.

Fonts booloptional

Whether to enable Cloudflare Fonts.

DeprecatedMirage booloptional
Mirage is deprecated. More information at https://developers.cloudflare.com/speed/optimization/images/mirage/.

Whether to enable Mirage.

OpportunisticEncryption booloptional

Whether to enable Opportunistic Encryption.

Polish SetConfigRuleActionParametersPolishoptional

The Polish level to configure.

One of the following:
const SetConfigRuleActionParametersPolishOff SetConfigRuleActionParametersPolish = "off"
const SetConfigRuleActionParametersPolishLossless SetConfigRuleActionParametersPolish = "lossless"
const SetConfigRuleActionParametersPolishLossy SetConfigRuleActionParametersPolish = "lossy"
const SetConfigRuleActionParametersPolishWebP SetConfigRuleActionParametersPolish = "webp"
RedirectsForAITraining booloptional

Whether to redirect verified AI training crawlers to canonical URLs found in the HTML response.

RequestBodyBuffering SetConfigRuleActionParametersRequestBodyBufferingoptional

The request body buffering mode.

One of the following:
const SetConfigRuleActionParametersRequestBodyBufferingNone SetConfigRuleActionParametersRequestBodyBuffering = "none"
const SetConfigRuleActionParametersRequestBodyBufferingStandard SetConfigRuleActionParametersRequestBodyBuffering = "standard"
const SetConfigRuleActionParametersRequestBodyBufferingFull SetConfigRuleActionParametersRequestBodyBuffering = "full"
ResponseBodyBuffering SetConfigRuleActionParametersResponseBodyBufferingoptional

The response body buffering mode.

One of the following:
const SetConfigRuleActionParametersResponseBodyBufferingNone SetConfigRuleActionParametersResponseBodyBuffering = "none"
const SetConfigRuleActionParametersResponseBodyBufferingStandard SetConfigRuleActionParametersResponseBodyBuffering = "standard"
RocketLoader booloptional

Whether to enable Rocket Loader.

SecurityLevel SetConfigRuleActionParametersSecurityLeveloptional

The Security Level to configure.

One of the following:
const SetConfigRuleActionParametersSecurityLevelOff SetConfigRuleActionParametersSecurityLevel = "off"
const SetConfigRuleActionParametersSecurityLevelEssentiallyOff SetConfigRuleActionParametersSecurityLevel = "essentially_off"
const SetConfigRuleActionParametersSecurityLevelLow SetConfigRuleActionParametersSecurityLevel = "low"
const SetConfigRuleActionParametersSecurityLevelMedium SetConfigRuleActionParametersSecurityLevel = "medium"
const SetConfigRuleActionParametersSecurityLevelHigh SetConfigRuleActionParametersSecurityLevel = "high"
const SetConfigRuleActionParametersSecurityLevelUnderAttack SetConfigRuleActionParametersSecurityLevel = "under_attack"
ServerSideExcludes booloptional

Whether to enable Server-Side Excludes.

SSL SetConfigRuleActionParametersSSLoptional

The SSL level to configure.

One of the following:
const SetConfigRuleActionParametersSSLOff SetConfigRuleActionParametersSSL = "off"
const SetConfigRuleActionParametersSSLFlexible SetConfigRuleActionParametersSSL = "flexible"
const SetConfigRuleActionParametersSSLFull SetConfigRuleActionParametersSSL = "full"
const SetConfigRuleActionParametersSSLStrict SetConfigRuleActionParametersSSL = "strict"
const SetConfigRuleActionParametersSSLOriginPull SetConfigRuleActionParametersSSL = "origin_pull"
SXG booloptional

Whether to enable Signed Exchanges (SXG).

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck SetConfigRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit SetConfigRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
type SkipRule struct{…}
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Version string

The version of the rule.

ID stringoptional

The unique ID of the rule.

Action SkipRuleActionoptional

The action to perform when the rule matches.

ActionParameters SkipRuleActionParametersoptional

The parameters configuring the rule's action.

Phase SkipRuleActionParametersPhaseoptional

A phase to skip the execution of. This option is only compatible with the products option.

Phases []Phaseoptional

A list of phases to skip the execution of. This option is incompatible with the rulesets option.

One of the following:
const PhaseDDoSL4 Phase = "ddos_l4"
const PhaseDDoSL7 Phase = "ddos_l7"
const PhaseHTTPConfigSettings Phase = "http_config_settings"
const PhaseHTTPCustomErrors Phase = "http_custom_errors"
const PhaseHTTPLogCustomFields Phase = "http_log_custom_fields"
const PhaseHTTPRatelimit Phase = "http_ratelimit"
const PhaseHTTPRequestCacheSettings Phase = "http_request_cache_settings"
const PhaseHTTPRequestDynamicRedirect Phase = "http_request_dynamic_redirect"
const PhaseHTTPRequestFirewallCustom Phase = "http_request_firewall_custom"
const PhaseHTTPRequestFirewallManaged Phase = "http_request_firewall_managed"
const PhaseHTTPRequestLateTransform Phase = "http_request_late_transform"
const PhaseHTTPRequestOrigin Phase = "http_request_origin"
const PhaseHTTPRequestRedirect Phase = "http_request_redirect"
const PhaseHTTPRequestSanitize Phase = "http_request_sanitize"
const PhaseHTTPRequestSBFM Phase = "http_request_sbfm"
const PhaseHTTPRequestTransform Phase = "http_request_transform"
const PhaseHTTPResponseCacheSettings Phase = "http_response_cache_settings"
const PhaseHTTPResponseCompression Phase = "http_response_compression"
const PhaseHTTPResponseFirewallManaged Phase = "http_response_firewall_managed"
const PhaseHTTPResponseHeadersTransform Phase = "http_response_headers_transform"
const PhaseMagicTransit Phase = "magic_transit"
const PhaseMagicTransitIDsManaged Phase = "magic_transit_ids_managed"
const PhaseMagicTransitManaged Phase = "magic_transit_managed"
const PhaseMagicTransitRatelimit Phase = "magic_transit_ratelimit"
Products []SkipRuleActionParametersProductoptional

A list of legacy security products to skip the execution of.

One of the following:
const SkipRuleActionParametersProductBIC SkipRuleActionParametersProduct = "bic"
const SkipRuleActionParametersProductHot SkipRuleActionParametersProduct = "hot"
const SkipRuleActionParametersProductRateLimit SkipRuleActionParametersProduct = "rateLimit"
const SkipRuleActionParametersProductSecurityLevel SkipRuleActionParametersProduct = "securityLevel"
const SkipRuleActionParametersProductUABlock SkipRuleActionParametersProduct = "uaBlock"
const SkipRuleActionParametersProductWAF SkipRuleActionParametersProduct = "waf"
const SkipRuleActionParametersProductZoneLockdown SkipRuleActionParametersProduct = "zoneLockdown"
Rules map[string, []string]optional

A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the execution of. This option is incompatible with the ruleset option.

Ruleset SkipRuleActionParametersRulesetoptional

A ruleset to skip the execution of. This option is incompatible with the rulesets option.

Rulesets []stringoptional

A list of ruleset IDs to skip the execution of. This option is incompatible with the ruleset and phases options.

Categories []stringoptional

The categories of the rule.

Description stringoptional

An informative description of the rule.

Enabled booloptional

Whether the rule should be executed.

ExposedCredentialCheck SkipRuleExposedCredentialCheckoptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Expression stringoptional

The expression defining which traffic will match the rule.

minLength1
Logging Loggingoptional

An object configuring the rule's logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit SkipRuleRatelimitoptional

An object configuring the rule's rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringoptional

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

minLength1
MitigationTimeout int64optional

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

RequestsPerPeriod int64optional

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

minimum1
RequestsToOrigin booloptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64optional

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

ScoreResponseHeaderName stringoptional

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

minLength1
Ref stringoptional

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

minLength1
Version string

The version of the ruleset.

Description stringoptional

An informative description of the ruleset.

Update an account or zone ruleset

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/rulesets"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  ruleset, err := client.Rulesets.Update(
    context.TODO(),
    "2f2feab2026849078ba485f918791bdc",
    rulesets.RulesetUpdateParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", ruleset.ID)
}
{
  "errors": [
    {
      "message": "something bad happened",
      "code": 10000,
      "source": {
        "pointer": "/rules/0/action"
      }
    }
  ],
  "messages": [
    {
      "message": "something bad happened",
      "code": 10000,
      "source": {
        "pointer": "/rules/0/action"
      }
    }
  ],
  "result": {
    "id": "2f2feab2026849078ba485f918791bdc",
    "kind": "root",
    "last_updated": "2000-01-01T00:00:00.000000Z",
    "name": "My ruleset",
    "phase": "http_request_firewall_custom",
    "rules": [
      {
        "last_updated": "2000-01-01T00:00:00.000000Z",
        "version": "1",
        "id": "3a03d665bac047339bb530ecb439a90d",
        "action": "block",
        "action_parameters": {
          "response": {
            "content": "{\n  \"success\": false,\n  \"error\": \"you have been blocked\"\n}",
            "content_type": "application/json",
            "status_code": 400
          }
        },
        "categories": [
          "directory-traversal"
        ],
        "description": "Block the request.",
        "enabled": true,
        "exposed_credential_check": {
          "password_expression": "url_decode(http.request.body.form[\\\"password\\\"][0])",
          "username_expression": "url_decode(http.request.body.form[\\\"username\\\"][0])"
        },
        "expression": "ip.src eq 1.1.1.1",
        "logging": {
          "enabled": true
        },
        "ratelimit": {
          "characteristics": [
            "cf.colo.id"
          ],
          "period": 60,
          "counting_expression": "http.request.body.raw eq \"abcd\"",
          "mitigation_timeout": 600,
          "requests_per_period": 1000,
          "requests_to_origin": true,
          "score_per_period": 400,
          "score_response_header_name": "my-score"
        },
        "ref": "my_ref"
      }
    ],
    "version": "1",
    "description": "A description for my ruleset."
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "message": "something bad happened",
      "code": 10000,
      "source": {
        "pointer": "/rules/0/action"
      }
    }
  ],
  "messages": [
    {
      "message": "something bad happened",
      "code": 10000,
      "source": {
        "pointer": "/rules/0/action"
      }
    }
  ],
  "result": {
    "id": "2f2feab2026849078ba485f918791bdc",
    "kind": "root",
    "last_updated": "2000-01-01T00:00:00.000000Z",
    "name": "My ruleset",
    "phase": "http_request_firewall_custom",
    "rules": [
      {
        "last_updated": "2000-01-01T00:00:00.000000Z",
        "version": "1",
        "id": "3a03d665bac047339bb530ecb439a90d",
        "action": "block",
        "action_parameters": {
          "response": {
            "content": "{\n  \"success\": false,\n  \"error\": \"you have been blocked\"\n}",
            "content_type": "application/json",
            "status_code": 400
          }
        },
        "categories": [
          "directory-traversal"
        ],
        "description": "Block the request.",
        "enabled": true,
        "exposed_credential_check": {
          "password_expression": "url_decode(http.request.body.form[\\\"password\\\"][0])",
          "username_expression": "url_decode(http.request.body.form[\\\"username\\\"][0])"
        },
        "expression": "ip.src eq 1.1.1.1",
        "logging": {
          "enabled": true
        },
        "ratelimit": {
          "characteristics": [
            "cf.colo.id"
          ],
          "period": 60,
          "counting_expression": "http.request.body.raw eq \"abcd\"",
          "mitigation_timeout": 600,
          "requests_per_period": 1000,
          "requests_to_origin": true,
          "score_per_period": 400,
          "score_response_header_name": "my-score"
        },
        "ref": "my_ref"
      }
    ],
    "version": "1",
    "description": "A description for my ruleset."
  },
  "success": true
}