Skip to content
Start here

Get an account or zone ruleset

client.Rulesets.Get(ctx, rulesetID, query) (*RulesetGetResponse, error)
GET/{accounts_or_zones}/{account_or_zone_id}/rulesets/{ruleset_id}

Fetches the latest version of an account or zone ruleset.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

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

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

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

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

The unique ID of the ruleset.

query RulesetGetParams
AccountID param.Field[string]Optional

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

ZoneID param.Field[string]Optional

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

ReturnsExpand Collapse
type RulesetGetResponse struct{…}

A ruleset object.

ID string

The unique ID of the ruleset.

Kind Kind

The kind of the ruleset.

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

The timestamp of when the ruleset was last modified.

formatdate-time
Name string

The human-readable name of the ruleset.

minLength1
Phase Phase

The phase of the ruleset.

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

The list of rules in the ruleset.

One of the following:
type RulesetGetResponseRulesBlockRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesChallengeRule struct{…}
ID string

The unique ID of the rule.

Action RulesetGetResponseRulesChallengeRuleAction

The action to perform when the rule matches.

Enabled bool

Whether the rule should be executed.

Expression string

The expression defining which traffic will match the rule.

minLength1
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Ref string

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

minLength1
Version string

The version of the rule.

ActionParameters unknownOptional

The parameters configuring the rule’s action.

Categories []stringOptional

The categories of the rule.

Description stringOptional

An informative description of the rule.

ExposedCredentialCheck RulesetGetResponseRulesChallengeRuleExposedCredentialCheckOptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Logging LoggingOptional

An object configuring the rule’s logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetGetResponseRulesChallengeRuleRatelimitOptional

An object configuring the rule’s rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringOptional

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

minLength1
MitigationTimeout int64Optional

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

RequestsPerPeriod int64Optional

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

minimum1
RequestsToOrigin boolOptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64Optional

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

ScoreResponseHeaderName stringOptional

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

minLength1
type RulesetGetResponseRulesResponseCompressionRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesDDoSDynamicRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesExecuteRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesForceConnectionCloseRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesJavaScriptChallengeRule struct{…}
ID string

The unique ID of the rule.

Action RulesetGetResponseRulesJavaScriptChallengeRuleAction

The action to perform when the rule matches.

Enabled bool

Whether the rule should be executed.

Expression string

The expression defining which traffic will match the rule.

minLength1
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Ref string

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

minLength1
Version string

The version of the rule.

ActionParameters unknownOptional

The parameters configuring the rule’s action.

Categories []stringOptional

The categories of the rule.

Description stringOptional

An informative description of the rule.

ExposedCredentialCheck RulesetGetResponseRulesJavaScriptChallengeRuleExposedCredentialCheckOptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Logging LoggingOptional

An object configuring the rule’s logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetGetResponseRulesJavaScriptChallengeRuleRatelimitOptional

An object configuring the rule’s rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringOptional

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

minLength1
MitigationTimeout int64Optional

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

RequestsPerPeriod int64Optional

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

minimum1
RequestsToOrigin boolOptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64Optional

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

ScoreResponseHeaderName stringOptional

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

minLength1
type RulesetGetResponseRulesLogRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesLogCustomFieldRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesManagedChallengeRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesRedirectRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesRewriteRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesRouteRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesScoreRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesServeErrorRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesSetCacheControlRule struct{…}
ID string

The unique ID of the rule.

Action RulesetGetResponseRulesSetCacheControlRuleAction

The action to perform when the rule matches.

Enabled bool
Expression string

The expression defining which traffic will match the rule.

minLength1
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Ref string

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

minLength1
Version string

The version of the rule.

ActionParameters RulesetGetResponseRulesSetCacheControlRuleActionParametersOptional

The parameters configuring the rule’s action.

Immutable RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableOptional

A cache-control directive configuration.

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirective struct{…}

Set the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

MaxAge RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeOptional

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

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly boolOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

MustRevalidate RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateOptional

A cache-control directive configuration.

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}

Set the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

MustUnderstand RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandOptional

A cache-control directive configuration.

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}

Set the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

NoCache RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheOptional

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

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}

Set the directive with optional qualifiers.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

Qualifiers []stringOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

NoStore RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreOptional

A cache-control directive configuration.

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}

Set the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

NoTransform RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformOptional

A cache-control directive configuration.

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}

Set the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

Private RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateOptional

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

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirective struct{…}

Set the directive with optional qualifiers.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

Qualifiers []stringOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

ProxyRevalidate RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateOptional

A cache-control directive configuration.

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}

Set the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

Public RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicOptional

A cache-control directive configuration.

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirective struct{…}

Set the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

SMaxage RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageOptional

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

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly boolOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

StaleIfError RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorOptional

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

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly boolOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

StaleWhileRevalidate RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateOptional

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

One of the following:
type RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "remove"
Value int64

The duration value in seconds for the directive.

minimum0
CloudflareOnly boolOptional

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

type RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}

Remove the directive.

Operation RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationSet RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "set"
const RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationRemove RulesetGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

Categories []stringOptional

The categories of the rule.

Description stringOptional

An informative description of the rule.

ExposedCredentialCheck RulesetGetResponseRulesSetCacheControlRuleExposedCredentialCheckOptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Logging LoggingOptional

An object configuring the rule’s logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetGetResponseRulesSetCacheControlRuleRatelimitOptional

An object configuring the rule’s rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringOptional

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

minLength1
MitigationTimeout int64Optional

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

RequestsPerPeriod int64Optional

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

minimum1
RequestsToOrigin boolOptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64Optional

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

ScoreResponseHeaderName stringOptional

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

minLength1
type RulesetGetResponseRulesSetCacheSettingsRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesSetCacheTagsRule struct{…}
ID string

The unique ID of the rule.

Action RulesetGetResponseRulesSetCacheTagsRuleAction

The action to perform when the rule matches.

Enabled bool
Expression string

The expression defining which traffic will match the rule.

minLength1
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Ref string

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

minLength1
Version string

The version of the rule.

ActionParameters RulesetGetResponseRulesSetCacheTagsRuleActionParametersOptional

The parameters configuring the rule’s action.

One of the following:
type RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}

Add cache tags using a list of values.

Operation RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationAdd RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "add"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationRemove RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "remove"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationSet RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}

Add cache tags using an expression.

Expression string

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

minLength1
Operation RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationAdd RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "add"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationRemove RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "remove"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationSet RulesetGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "set"
type RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}

Remove cache tags using a list of values.

Operation RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationAdd RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "add"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationRemove RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "remove"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationSet RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}

Remove cache tags using an expression.

Expression string

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

minLength1
Operation RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationAdd RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "add"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationRemove RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "remove"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationSet RulesetGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "set"
type RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}

Set cache tags using a list of values.

Operation RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationAdd RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "add"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationRemove RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "remove"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationSet RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}

Set cache tags using an expression.

Expression string

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

minLength1
Operation RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationAdd RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "add"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationRemove RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "remove"
const RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationSet RulesetGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "set"
Categories []stringOptional

The categories of the rule.

Description stringOptional

An informative description of the rule.

ExposedCredentialCheck RulesetGetResponseRulesSetCacheTagsRuleExposedCredentialCheckOptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Logging LoggingOptional

An object configuring the rule’s logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetGetResponseRulesSetCacheTagsRuleRatelimitOptional

An object configuring the rule’s rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringOptional

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

minLength1
MitigationTimeout int64Optional

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

RequestsPerPeriod int64Optional

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

minimum1
RequestsToOrigin boolOptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64Optional

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

ScoreResponseHeaderName stringOptional

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

minLength1
type RulesetGetResponseRulesSetConfigurationRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesSkipRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type RulesetGetResponseRulesTransformResponseHTMLRule struct{…}
ID string

The unique ID of the rule.

Action RulesetGetResponseRulesTransformResponseHTMLRuleAction

The action to perform when the rule matches.

Enabled bool
Expression string

The expression defining which traffic will match the rule.

minLength1
LastUpdated Time

The timestamp of when the rule was last modified.

formatdate-time
Ref string

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

minLength1
Version string

The version of the rule.

ActionParameters RulesetGetResponseRulesTransformResponseHTMLRuleActionParametersOptional

The parameters configuring the rule’s action.

Categories []stringOptional

The categories of the rule.

Description stringOptional

An informative description of the rule.

ExposedCredentialCheck RulesetGetResponseRulesTransformResponseHTMLRuleExposedCredentialCheckOptional

Configuration for exposed credential checking.

PasswordExpression string

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

minLength1
UsernameExpression string

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

minLength1
Logging LoggingOptional

An object configuring the rule’s logging behavior.

Enabled bool

Whether to generate a log when the rule matches.

Ratelimit RulesetGetResponseRulesTransformResponseHTMLRuleRatelimitOptional

An object configuring the rule’s rate limit behavior.

Characteristics []string

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

Period int64

Period in seconds over which the counter is being incremented.

minimum0
CountingExpression stringOptional

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

minLength1
MitigationTimeout int64Optional

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

RequestsPerPeriod int64Optional

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

minimum1
RequestsToOrigin boolOptional

Whether counting is only performed when an origin is reached.

ScorePerPeriod int64Optional

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

ScoreResponseHeaderName stringOptional

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

minLength1
Version string

The version of the ruleset.

Description stringOptional

An informative description of the ruleset.

Get 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.Get(
    context.TODO(),
    "2f2feab2026849078ba485f918791bdc",
    rulesets.RulesetGetParams{

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