Create an account or zone ruleset
Creates a ruleset.
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
params RulesetNewParams
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[[]RulesetNewParamsRule]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 RulesetNewParamsRulesRulesetsChallengeRule struct{…}
The action to perform when the rule matches.
ExposedCredentialCheck RulesetNewParamsRulesRulesetsChallengeRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RulesetNewParamsRulesRulesetsChallengeRuleRatelimitOptionalAn 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 RulesetNewParamsRulesRulesetsJSChallengeRule struct{…}
The action to perform when the rule matches.
ExposedCredentialCheck RulesetNewParamsRulesRulesetsJSChallengeRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RulesetNewParamsRulesRulesetsJSChallengeRuleRatelimitOptionalAn 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 RulesetNewParamsRulesRulesetsSetCacheControlRule struct{…}
The action to perform when the rule matches.
ActionParameters RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
Immutable RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MaxAge RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MustRevalidate RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MustUnderstand RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoCache RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheOptionalA cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoStore RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoTransform RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
Private RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateOptionalA cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirective struct{…}Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
ProxyRevalidate RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
Public RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersPublicOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersPublicSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
SMaxage RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
StaleIfError RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
StaleWhileRevalidate RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewParamsRulesRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
ExposedCredentialCheck RulesetNewParamsRulesRulesetsSetCacheControlRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RulesetNewParamsRulesRulesetsSetCacheControlRuleRatelimitOptionalAn 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 RulesetNewParamsRulesRulesetsSetCacheTagsRule struct{…}
The action to perform when the rule matches.
ActionParameters RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
type RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}Add cache tags using a list of values.
Add cache tags using a list of values.
Operation RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}Add cache tags using an expression.
Add cache tags using an expression.
Operation RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}Remove cache tags using a list of values.
Remove cache tags using a list of values.
Operation RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}Remove cache tags using an expression.
Remove cache tags using an expression.
Operation RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}Set cache tags using a list of values.
Set cache tags using a list of values.
Operation RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}Set cache tags using an expression.
Set cache tags using an expression.
Operation RulesetNewParamsRulesRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
ExposedCredentialCheck RulesetNewParamsRulesRulesetsSetCacheTagsRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RulesetNewParamsRulesRulesetsSetCacheTagsRuleRatelimitOptionalAn 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 RulesetNewParamsRulesRulesetsTransformResponseHTMLRule struct{…}
The action to perform when the rule matches.
ActionParameters RulesetNewParamsRulesRulesetsTransformResponseHTMLRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
ExposedCredentialCheck RulesetNewParamsRulesRulesetsTransformResponseHTMLRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RulesetNewParamsRulesRulesetsTransformResponseHTMLRuleRatelimitOptionalAn 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 RulesetNewResponseUnion interface{…}A result.
A result.
type RulesetNewResponseRuleset 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 []RulesetNewResponseRulesetRuleThe list of rules in the ruleset.
The list of rules in the ruleset.
type RulesetNewResponseRulesetRulesChallengeRule struct{…}
The action to perform when the rule matches.
ExposedCredentialCheck RulesetNewResponseRulesetRulesChallengeRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RulesetNewResponseRulesetRulesChallengeRuleRatelimitOptionalAn 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 RulesetNewResponseRulesetRulesJavaScriptChallengeRule struct{…}
The action to perform when the rule matches.
ExposedCredentialCheck RulesetNewResponseRulesetRulesJavaScriptChallengeRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RulesetNewResponseRulesetRulesJavaScriptChallengeRuleRatelimitOptionalAn 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 RulesetNewResponseRulesetRulesSetCacheControlRule struct{…}
The action to perform when the rule matches.
ActionParameters RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
Immutable RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersImmutableOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersImmutableSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MaxAge RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMaxAgeOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MustRevalidate RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMustRevalidateOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
MustUnderstand RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMustUnderstandOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoCache RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoCacheOptionalA cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoStore RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoStoreOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
NoTransform RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoTransformOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
Private RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersPrivateOptionalA cache-control directive configuration that accepts optional qualifiers (header names).
A cache-control directive configuration that accepts optional qualifiers (header names).
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersPrivateSetDirective struct{…}Set the directive with optional qualifiers.
Set the directive with optional qualifiers.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
ProxyRevalidate RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersProxyRevalidateOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
Public RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersPublicOptionalA cache-control directive configuration.
A cache-control directive configuration.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersPublicSetDirective struct{…}Set the directive.
Set the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
SMaxage RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersSMaxageOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
StaleIfError RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersStaleIfErrorOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
StaleWhileRevalidate RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersStaleWhileRevalidateOptionalA cache-control directive configuration that accepts a duration value in seconds.
A cache-control directive configuration that accepts a duration value in seconds.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}Set the directive with a duration value in seconds.
Set the directive with a duration value in seconds.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
type RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}Remove the directive.
Remove the directive.
Operation RulesetNewResponseRulesetRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationThe operation to perform on the cache-control directive.
The operation to perform on the cache-control directive.
ExposedCredentialCheck RulesetNewResponseRulesetRulesSetCacheControlRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RulesetNewResponseRulesetRulesSetCacheControlRuleRatelimitOptionalAn 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 RulesetNewResponseRulesetRulesSetCacheTagsRule struct{…}
The action to perform when the rule matches.
ActionParameters RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
type RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}Add cache tags using a list of values.
Add cache tags using a list of values.
Operation RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}Add cache tags using an expression.
Add cache tags using an expression.
Operation RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}Remove cache tags using a list of values.
Remove cache tags using a list of values.
Operation RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}Remove cache tags using an expression.
Remove cache tags using an expression.
Operation RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}Set cache tags using a list of values.
Set cache tags using a list of values.
Operation RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
type RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}Set cache tags using an expression.
Set cache tags using an expression.
Operation RulesetNewResponseRulesetRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationThe operation to perform on the cache tags.
The operation to perform on the cache tags.
ExposedCredentialCheck RulesetNewResponseRulesetRulesSetCacheTagsRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RulesetNewResponseRulesetRulesSetCacheTagsRuleRatelimitOptionalAn 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 RulesetNewResponseRulesetRulesTransformResponseHTMLRule struct{…}
The action to perform when the rule matches.
ActionParameters RulesetNewResponseRulesetRulesTransformResponseHTMLRuleActionParametersOptionalThe parameters configuring the rule’s action.
The parameters configuring the rule’s action.
ExposedCredentialCheck RulesetNewResponseRulesetRulesTransformResponseHTMLRuleExposedCredentialCheckOptionalConfiguration for exposed credential checking.
Configuration for exposed credential checking.
Ratelimit RulesetNewResponseRulesetRulesTransformResponseHTMLRuleRatelimitOptionalAn 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.
Create an account or zone ruleset
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/rulesets"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
ruleset, err := client.Rulesets.New(context.TODO(), rulesets.RulesetNewParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", ruleset)
}
{
"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
}