Skip to content
Start here

Update an account or zone entry point ruleset

client.Rulesets.Phases.Update(ctx, rulesetPhase, params) (*PhaseUpdateResponse, error)
PUT/{accounts_or_zones}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint

Updates an account or zone entry point 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
RulesetPhase 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"
params PhaseUpdateParams
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.

Name param.Field[string]optional

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

minLength1
Rules param.Field[[]PhaseUpdateParamsRule]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 PhaseUpdateParamsRulesRulesetsChallengeRule 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 PhaseUpdateParamsRulesRulesetsChallengeRuleActionoptional

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 PhaseUpdateParamsRulesRulesetsChallengeRuleExposedCredentialCheckoptional

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 PhaseUpdateParamsRulesRulesetsChallengeRuleRatelimitoptional

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 PhaseUpdateParamsRulesRulesetsJSChallengeRule 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 PhaseUpdateParamsRulesRulesetsJSChallengeRuleActionoptional

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 PhaseUpdateParamsRulesRulesetsJSChallengeRuleExposedCredentialCheckoptional

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 PhaseUpdateParamsRulesRulesetsJSChallengeRuleRatelimitoptional

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 PhaseUpdateParamsRulesRulesetsSetCacheControlRule 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 PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionoptional

The action to perform when the rule matches.

ActionParameters PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersoptional

The parameters configuring the rule's action.

Immutable PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirective struct{…}

Set the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MaxAge PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeoptional

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

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "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 PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MustRevalidate PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}

Set the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MustUnderstand PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}

Set the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoCache PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheoptional

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

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}

Set the directive with optional qualifiers.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "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 PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoStore PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}

Set the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoTransform PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}

Set the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Private PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateoptional

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

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirective struct{…}

Set the directive with optional qualifiers.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "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 PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

ProxyRevalidate PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}

Set the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Public PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirective struct{…}

Set the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

SMaxage PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageoptional

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

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "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 PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

StaleIfError PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErroroptional

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

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "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 PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

StaleWhileRevalidate PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateoptional

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

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "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 PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationSet PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "set"
const PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "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 PhaseUpdateParamsRulesRulesetsSetCacheControlRuleExposedCredentialCheckoptional

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 PhaseUpdateParamsRulesRulesetsSetCacheControlRuleRatelimitoptional

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 PhaseUpdateParamsRulesRulesetsSetCacheTagsRule 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 PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionoptional

The action to perform when the rule matches.

ActionParameters PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersoptional

The parameters configuring the rule's action.

One of the following:
type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}

Add cache tags using a list of values.

Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationAdd PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "add"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "remove"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationSet PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}

Add cache tags using an expression.

Expression string

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

minLength1
Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationAdd PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "add"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "remove"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationSet PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "set"
type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}

Remove cache tags using a list of values.

Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationAdd PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "add"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "remove"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationSet PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}

Remove cache tags using an expression.

Expression string

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

minLength1
Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationAdd PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "add"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "remove"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationSet PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "set"
type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}

Set cache tags using a list of values.

Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationAdd PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "add"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "remove"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationSet PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}

Set cache tags using an expression.

Expression string

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

minLength1
Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationAdd PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "add"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationRemove PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "remove"
const PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationSet PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "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 PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleExposedCredentialCheckoptional

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 PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleRatelimitoptional

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 PhaseUpdateResponse 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 []PhaseUpdateResponseRule

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 PhaseUpdateResponseRulesRulesetsChallengeRule 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 PhaseUpdateResponseRulesRulesetsChallengeRuleActionoptional

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 PhaseUpdateResponseRulesRulesetsChallengeRuleExposedCredentialCheckoptional

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 PhaseUpdateResponseRulesRulesetsChallengeRuleRatelimitoptional

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 PhaseUpdateResponseRulesRulesetsJSChallengeRule 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 PhaseUpdateResponseRulesRulesetsJSChallengeRuleActionoptional

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 PhaseUpdateResponseRulesRulesetsJSChallengeRuleExposedCredentialCheckoptional

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 PhaseUpdateResponseRulesRulesetsJSChallengeRuleRatelimitoptional

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 PhaseUpdateResponseRulesRulesetsSetCacheControlRule 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 PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionoptional

The action to perform when the rule matches.

ActionParameters PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersoptional

The parameters configuring the rule's action.

Immutable PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirective struct{…}

Set the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MaxAge PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeoptional

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

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "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 PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MustRevalidate PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}

Set the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

MustUnderstand PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}

Set the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoCache PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheoptional

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

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}

Set the directive with optional qualifiers.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "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 PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoStore PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}

Set the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

NoTransform PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}

Set the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Private PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateoptional

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

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirective struct{…}

Set the directive with optional qualifiers.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "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 PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

ProxyRevalidate PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}

Set the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

Public PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicoptional

A cache-control directive configuration.

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirective struct{…}

Set the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "remove"
CloudflareOnly booloptional

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

type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

SMaxage PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageoptional

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

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "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 PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

StaleIfError PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErroroptional

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

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "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 PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "remove"
CloudflareOnly booloptional

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

StaleWhileRevalidate PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateoptional

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

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "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 PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}

Remove the directive.

Operation PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationSet PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "set"
const PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "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 PhaseUpdateResponseRulesRulesetsSetCacheControlRuleExposedCredentialCheckoptional

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 PhaseUpdateResponseRulesRulesetsSetCacheControlRuleRatelimitoptional

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 PhaseUpdateResponseRulesRulesetsSetCacheTagsRule 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 PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionoptional

The action to perform when the rule matches.

ActionParameters PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersoptional

The parameters configuring the rule's action.

One of the following:
type PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}

Add cache tags using a list of values.

Operation PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationAdd PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "add"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "remove"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationSet PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}

Add cache tags using an expression.

Expression string

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

minLength1
Operation PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationAdd PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "add"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "remove"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationSet PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "set"
type PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}

Remove cache tags using a list of values.

Operation PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationAdd PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "add"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "remove"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationSet PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}

Remove cache tags using an expression.

Expression string

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

minLength1
Operation PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationAdd PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "add"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "remove"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationSet PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "set"
type PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}

Set cache tags using a list of values.

Operation PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationAdd PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "add"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "remove"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationSet PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}

Set cache tags using an expression.

Expression string

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

minLength1
Operation PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationAdd PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "add"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationRemove PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "remove"
const PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationSet PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "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 PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleExposedCredentialCheckoptional

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 PhaseUpdateResponseRulesRulesetsSetCacheTagsRuleRatelimitoptional

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 entry point 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"),
  )
  phase, err := client.Rulesets.Phases.Update(
    context.TODO(),
    rulesets.PhaseHTTPRequestFirewallCustom,
    rulesets.PhaseUpdateParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", phase.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
}