Update an account or zone entry point ruleset
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.
Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYYAPI Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194Accepted Permissions (at least one required)
Mass URL Redirects WriteMagic Firewall WriteL4 DDoS Managed Ruleset WriteTransform Rules WriteSelect Configuration WriteAccount WAF WriteAccount Rulesets WriteLogs WriteParametersExpand Collapse
RulesetPhase PhaseThe phase of the ruleset.
The phase of the ruleset.
params PhaseUpdateParams
Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
Query param: Validates the request without persisting changes when set to true. Responses that normally return 200 return result: null; endpoints that normally return 204 continue to return 204.
Rules param.Field[[]PhaseUpdateParamsRule]OptionalBody param: The list of rules in the ruleset.
Body param: The list of rules in the ruleset.
type BlockRuleParam struct{…}
ExposedCredentialCheck BlockRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit BlockRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type PhaseUpdateParamsRulesRulesetsChallengeRule struct{…}
The action to perform when the rule matches.
ExposedCredentialCheck PhaseUpdateParamsRulesRulesetsChallengeRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit PhaseUpdateParamsRulesRulesetsChallengeRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type CompressResponseRuleParam struct{…}
ActionParameters CompressResponseRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
Algorithms []CompressResponseRuleActionParametersAlgorithmCustom order for compression algorithms.
Custom order for compression algorithms.
Name CompressResponseRuleActionParametersAlgorithmsNameOptionalName of the compression algorithm to enable.
Name of the compression algorithm to enable.
ExposedCredentialCheck CompressResponseRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit CompressResponseRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type DDoSDynamicRuleParam struct{…}
ExposedCredentialCheck DDoSDynamicRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit DDoSDynamicRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type ExecuteRuleParam struct{…}
ActionParameters ExecuteRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
MatchedData ExecuteRuleActionParametersMatchedDataOptionalThe configuration to use for matched data logging.
The configuration to use for matched data logging.
Overrides ExecuteRuleActionParametersOverridesOptionalA set of overrides to apply to the target ruleset.
A set of overrides to apply to the target ruleset.
An action to override all rules with. This option has lower precedence than rule and category overrides.
Categories []ExecuteRuleActionParametersOverridesCategoryOptionalA list of category-level overrides. This option has the second-highest precedence after rule-level overrides.
A list of category-level overrides. This option has the second-highest precedence after rule-level overrides.
SensitivityLevel ExecuteRuleActionParametersOverridesCategoriesSensitivityLevelOptionalThe sensitivity level to use for rules in the category. This option is only applicable for DDoS phases.
The sensitivity level to use for rules in the category. This option is only applicable for DDoS phases.
Whether to enable execution of all rules. This option has lower precedence than rule and category overrides.
Rules []ExecuteRuleActionParametersOverridesRuleOptionalA list of rule-level overrides. This option has the highest precedence.
A list of rule-level overrides. This option has the highest precedence.
SensitivityLevel ExecuteRuleActionParametersOverridesRulesSensitivityLevelOptionalThe sensitivity level to use for the rule. This option is only applicable for DDoS phases.
The sensitivity level to use for the rule. This option is only applicable for DDoS phases.
SensitivityLevel ExecuteRuleActionParametersOverridesSensitivityLevelOptionalA sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases.
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.
ExposedCredentialCheck ExecuteRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit ExecuteRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type ForceConnectionCloseRuleParam struct{…}
ExposedCredentialCheck ForceConnectionCloseRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit ForceConnectionCloseRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type PhaseUpdateParamsRulesRulesetsJSChallengeRule struct{…}
The action to perform when the rule matches.
ExposedCredentialCheck PhaseUpdateParamsRulesRulesetsJSChallengeRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit PhaseUpdateParamsRulesRulesetsJSChallengeRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type LogRuleParam struct{…}
ExposedCredentialCheck LogRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit LogRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type LogCustomFieldRuleParam struct{…}
ActionParameters LogCustomFieldRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
RawResponseFields []LogCustomFieldRuleActionParametersRawResponseFieldOptionalThe raw response fields to log.
The raw response fields to log.
RequestFields []LogCustomFieldRuleActionParametersRequestFieldOptionalThe raw request fields to log.
The raw request fields to log.
ExposedCredentialCheck LogCustomFieldRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit LogCustomFieldRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type ManagedChallengeRuleParam struct{…}
ExposedCredentialCheck ManagedChallengeRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit ManagedChallengeRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type RedirectRuleParam struct{…}
ActionParameters RedirectRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
FromValue RedirectRuleActionParametersFromValueOptionalA redirect based on the request properties.
A redirect based on the request properties.
StatusCode RedirectRuleActionParametersFromValueStatusCodeOptionalThe status code to use for the redirect.
The status code to use for the redirect.
ExposedCredentialCheck RedirectRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RedirectRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type RewriteRuleParam struct{…}
ActionParameters RewriteRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
Headers map[string, RewriteRuleActionParametersHeader]OptionalA map of headers to rewrite.
A map of headers to rewrite.
type RewriteRuleActionParametersHeadersAddStaticHeaderParam struct{…}A header with a static value to add.
A header with a static value to add.
type RewriteRuleActionParametersHeadersAddDynamicHeaderParam struct{…}A header with a dynamic value to add.
A header with a dynamic value to add.
type RewriteRuleActionParametersHeadersSetStaticHeaderParam struct{…}A header with a static value to set.
A header with a static value to set.
URI RewriteRuleActionParametersURIOptionalA URI path rewrite.
A URI path rewrite.
ExposedCredentialCheck RewriteRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RewriteRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type RouteRuleParam struct{…}
ActionParameters RouteRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
ExposedCredentialCheck RouteRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RouteRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type ScoreRuleParam struct{…}
ExposedCredentialCheck ScoreRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit ScoreRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type ServeErrorRuleParam struct{…}
ActionParameters ServeErrorRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
type ServeErrorRuleActionParametersActionParametersContentParam struct{…}
ContentType ServeErrorRuleActionParametersActionParametersContentContentTypeOptionalThe content type header to set with the error response.
The content type header to set with the error response.
type ServeErrorRuleActionParametersActionParametersAssetParam struct{…}
ContentType ServeErrorRuleActionParametersActionParametersAssetContentTypeOptionalThe content type header to set with the error response.
The content type header to set with the error response.
ExposedCredentialCheck ServeErrorRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit ServeErrorRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRule struct{…}
The action to perform when the rule matches.
ActionParameters PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
Immutable PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MaxAge PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MustRevalidate PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MustUnderstand PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoCache PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheOptionalA cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoStore PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoTransform PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
Private PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateOptionalA cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirective struct{…}Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
ProxyRevalidate PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
Public PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
SMaxage PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
StaleIfError PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
StaleWhileRevalidate PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
ExposedCredentialCheck PhaseUpdateParamsRulesRulesetsSetCacheControlRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit PhaseUpdateParamsRulesRulesetsSetCacheControlRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type SetCacheSettingsRuleParam struct{…}
ActionParameters SetCacheSettingsRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
A list of additional ports that caching should be enabled on.
BrowserTTL SetCacheSettingsRuleActionParametersBrowserTTLOptionalHow 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.
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 SetCacheSettingsRuleActionParametersBrowserTTLModeThe browser TTL mode.
The browser TTL mode.
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 SetCacheSettingsRuleActionParametersCacheKeyOptionalWhich components of the request are included in or excluded from the cache key Cloudflare uses to store the response in cache.
Which components of the request are included in or excluded from the cache key Cloudflare uses to store the response in cache.
Whether to separate cached content based on the visitor’s device type.
Whether to protect from web cache deception attacks, while allowing static assets to be cached.
CustomKey SetCacheSettingsRuleActionParametersCacheKeyCustomKeyOptionalWhich components of the request are included or excluded from the cache key.
Which components of the request are included or excluded from the cache key.
Cookie SetCacheSettingsRuleActionParametersCacheKeyCustomKeyCookieOptionalWhich cookies to include in the cache key.
Which cookies to include in the cache key.
Header SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeaderOptionalWhich headers to include in the cache key.
Which headers to include in the cache key.
A list of headers to check for the presence of. The presence of these headers is included in the cache key.
Host SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHostOptionalHow to use the host in the cache key.
How to use the host in the cache key.
QueryString SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringOptionalWhich query string parameters to include in or exclude from the cache key.
Which query string parameters to include in or exclude from the cache key.
CacheReserve SetCacheSettingsRuleActionParametersCacheReserveOptionalSettings to determine whether the request’s response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan).
Settings to determine whether the request’s response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan).
EdgeTTL SetCacheSettingsRuleActionParametersEdgeTTLOptionalHow long the Cloudflare edge network should cache the response.
How long the Cloudflare edge network should cache the response.
Mode SetCacheSettingsRuleActionParametersEdgeTTLModeThe edge TTL mode.
The edge TTL mode.
StatusCodeTTL []SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLOptionalA list of TTLs to apply to specific status codes or status code ranges.
A list of TTLs to apply to specific status codes or status code ranges.
Whether to generate Cloudflare error pages for issues from the origin server.
OriginRangeRequests SetCacheSettingsRuleActionParametersOriginRangeRequestsOptionalControls whether Cloudflare fetches a large asset from the origin as a series of range requests instead of one whole-body request.
Controls whether Cloudflare fetches a large asset from the origin as a series of range requests instead of one whole-body request.
Mode SetCacheSettingsRuleActionParametersOriginRangeRequestsModeWhether to use range requests. default is the behaviour the zone gets without this rule.
Whether to use range requests. default is the behaviour the zone gets without this rule.
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.
Whether Cloudflare should respect strong ETag (entity tag) headers. If false, Cloudflare converts strong ETag headers to weak ETag headers.
ServeStale SetCacheSettingsRuleActionParametersServeStaleOptionalWhen to serve stale content from cache.
When to serve stale content from cache.
SharedDictionary SetCacheSettingsRuleActionParametersSharedDictionaryOptionalConfiguration for shared dictionary compression. When set, Cloudflare injects Use-As-Dictionary headers on matching cacheable responses.
Configuration for shared dictionary compression. When set, Cloudflare injects Use-As-Dictionary headers on matching cacheable responses.
Whether to strip Last-Modified headers from the origin response before caching.
Whether to strip Set-Cookie headers from the origin response before caching.
Vary SetCacheSettingsRuleActionParametersVaryOptionalControls how cached responses vary based on request headers. default is required by the API and applies to any Vary response header that does not have a per-header override.
Controls how cached responses vary based on request headers. default is required by the API and applies to any Vary response header that does not have a per-header override.
Default SetCacheSettingsRuleActionParametersVaryDefaultOptionalControls how response Vary headers without a per-header override contribute to the cache key.
Controls how response Vary headers without a per-header override contribute to the cache key.
Action SetCacheSettingsRuleActionParametersVaryDefaultActionHow the header value is treated when building the cache key.
How the header value is treated when building the cache key.
Headers map[string, SetCacheSettingsRuleActionParametersVaryHeader]OptionalA mapping of lowercase request header names to their vary configuration.
A mapping of lowercase request header names to their vary configuration.
Action SetCacheSettingsRuleActionParametersVaryHeadersActionHow the header value is treated when building the cache key.
How the header value is treated when building the cache key.
ExposedCredentialCheck SetCacheSettingsRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit SetCacheSettingsRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type PhaseUpdateParamsRulesRulesetsSetCacheTagsRule struct{…}
The action to perform when the rule matches.
ActionParameters PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}Add cache tags using a list of values.
Add cache tags using a list of values.
Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}Add cache tags using an expression.
Add cache tags using an expression.
Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}Remove cache tags using a list of values.
Remove cache tags using a list of values.
Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}Remove cache tags using an expression.
Remove cache tags using an expression.
Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}Set cache tags using a list of values.
Set cache tags using a list of values.
Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}Set cache tags using an expression.
Set cache tags using an expression.
Operation PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
ExposedCredentialCheck PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit PhaseUpdateParamsRulesRulesetsSetCacheTagsRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type SetConfigRuleParam struct{…}
ActionParameters SetConfigRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
Autominify SetConfigRuleActionParametersAutominifyOptionalWhich file extensions to minify automatically.
Which file extensions to minify automatically.
Cloudflare Apps are deprected.
Whether to disable Cloudflare Apps.
Whether to disable Pay Per Crawl.
Whether to disable Real User Monitoring (RUM).
Mirage is deprecated. More information at https://developers.cloudflare.com/speed/optimization/images/mirage/.
Whether to enable Mirage.
Polish SetConfigRuleActionParametersPolishOptionalThe Polish level to configure.
The Polish level to configure.
Whether to redirect verified AI training crawlers to canonical URLs found in the HTML response.
RequestBodyBuffering SetConfigRuleActionParametersRequestBodyBufferingOptionalThe request body buffering mode.
The request body buffering mode.
ResponseBodyBuffering SetConfigRuleActionParametersResponseBodyBufferingOptionalThe response body buffering mode.
The response body buffering mode.
SecurityLevel SetConfigRuleActionParametersSecurityLevelOptionalThe Security Level to configure.
The Security Level to configure.
Signed Exchanges (SXG) is deprecated.
Whether to enable Signed Exchanges (SXG).
ExposedCredentialCheck SetConfigRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit SetConfigRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type SkipRuleParam struct{…}
ActionParameters SkipRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
A phase to skip the execution of. This option is only compatible with the products option.
A list of phases to skip the execution of. This option is incompatible with the rulesets option.
A list of phases to skip the execution of. This option is incompatible with the rulesets option.
Products []SkipRuleActionParametersProductOptionalA list of legacy security products to skip the execution of.
A list of legacy security products to skip the execution of.
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.
ExposedCredentialCheck SkipRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit SkipRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type PhaseUpdateParamsRulesRulesetsTransformResponseHTMLRule struct{…}
The action to perform when the rule matches.
ActionParameters PhaseUpdateParamsRulesRulesetsTransformResponseHTMLRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
ExposedCredentialCheck PhaseUpdateParamsRulesRulesetsTransformResponseHTMLRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit PhaseUpdateParamsRulesRulesetsTransformResponseHTMLRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
ReturnsExpand Collapse
type PhaseUpdateResponseUnion interface{…}A result.
A result.
type PhaseUpdateResponseRuleset struct{…}A ruleset object.
A ruleset object.
Kind KindThe kind of the ruleset.
The kind of the ruleset.
Phase PhaseThe phase of the ruleset.
The phase of the ruleset.
Rules []PhaseUpdateResponseRulesetRuleThe list of rules in the ruleset.
The list of rules in the ruleset.
type PhaseUpdateResponseRulesetRulesChallengeRule struct{…}
The action to perform when the rule matches.
ExposedCredentialCheck PhaseUpdateResponseRulesetRulesChallengeRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit PhaseUpdateResponseRulesetRulesChallengeRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type PhaseUpdateResponseRulesetRulesJavaScriptChallengeRule struct{…}
The action to perform when the rule matches.
ExposedCredentialCheck PhaseUpdateResponseRulesetRulesJavaScriptChallengeRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit PhaseUpdateResponseRulesetRulesJavaScriptChallengeRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type PhaseUpdateResponseRulesetRulesSetCacheControlRule struct{…}
The action to perform when the rule matches.
ActionParameters PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
Immutable PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersImmutableOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersImmutableSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MaxAge PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMaxAgeOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MustRevalidate PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMustRevalidateOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MustUnderstand PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMustUnderstandOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoCache PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoCacheOptionalA cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoStore PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoStoreOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoTransform PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoTransformOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
Private PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersPrivateOptionalA cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersPrivateSetDirective struct{…}Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
ProxyRevalidate PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersProxyRevalidateOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
Public PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersPublicOptionalA cache-control directive configuration.
A cache-control directive configuration.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersPublicSetDirective struct{…}Set the directive.
Set the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
SMaxage PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersSMaxageOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
StaleIfError PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersStaleIfErrorOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
StaleWhileRevalidate PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersStaleWhileRevalidateOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation PhaseUpdateResponseRulesetRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
ExposedCredentialCheck PhaseUpdateResponseRulesetRulesSetCacheControlRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit PhaseUpdateResponseRulesetRulesSetCacheControlRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type PhaseUpdateResponseRulesetRulesSetCacheTagsRule struct{…}
The action to perform when the rule matches.
ActionParameters PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
type PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}Add cache tags using a list of values.
Add cache tags using a list of values.
Operation PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}Add cache tags using an expression.
Add cache tags using an expression.
Operation PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}Remove cache tags using a list of values.
Remove cache tags using a list of values.
Operation PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}Remove cache tags using an expression.
Remove cache tags using an expression.
Operation PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}Set cache tags using a list of values.
Set cache tags using a list of values.
Operation PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}Set cache tags using an expression.
Set cache tags using an expression.
Operation PhaseUpdateResponseRulesetRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
ExposedCredentialCheck PhaseUpdateResponseRulesetRulesSetCacheTagsRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit PhaseUpdateResponseRulesetRulesSetCacheTagsRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
type PhaseUpdateResponseRulesetRulesTransformResponseHTMLRule struct{…}
The action to perform when the rule matches.
ActionParameters PhaseUpdateResponseRulesetRulesTransformResponseHTMLRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
ExposedCredentialCheck PhaseUpdateResponseRulesetRulesTransformResponseHTMLRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit PhaseUpdateResponseRulesetRulesTransformResponseHTMLRuleRatelimitOptionalAn object configuring the rule’s rate limit behavior.
An object configuring the rule’s rate limit behavior.
Characteristics of the request on which the rate limit counter will be incremented.
An expression that defines when the rate limit counter should be incremented. It defaults to the same as the rule’s expression.
Period of time in seconds after which the action will be disabled following its first execution.
The threshold of requests per period after which the action will be executed for the first time.
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)
}
{
"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": {},
"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": {},
"success": true
}