Skip to content
Start here

Get an account or zone ruleset version

client.Rulesets.Versions.Get(ctx, rulesetID, rulesetVersion, query) (*VersionGetResponse, error)
GET/{accounts_or_zones}/{account_or_zone_id}/rulesets/{ruleset_id}/versions/{ruleset_version}

Fetches a specific 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.

rulesetVersion string

The version of the ruleset.

query VersionGetParams
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 VersionGetResponse 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 []VersionGetResponseRule

The list of rules in the ruleset.

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

The unique ID of the rule.

Action VersionGetResponseRulesChallengeRuleAction

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 VersionGetResponseRulesChallengeRuleExposedCredentialCheckOptional

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 VersionGetResponseRulesChallengeRuleRatelimitOptional

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 VersionGetResponseRulesResponseCompressionRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesDDoSDynamicRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesExecuteRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesForceConnectionCloseRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesJavaScriptChallengeRule struct{…}
ID string

The unique ID of the rule.

Action VersionGetResponseRulesJavaScriptChallengeRuleAction

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 VersionGetResponseRulesJavaScriptChallengeRuleExposedCredentialCheckOptional

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 VersionGetResponseRulesJavaScriptChallengeRuleRatelimitOptional

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 VersionGetResponseRulesLogRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesLogCustomFieldRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesManagedChallengeRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesRedirectRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesRewriteRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesRouteRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesScoreRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesServeErrorRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesSetCacheControlRule struct{…}
ID string

The unique ID of the rule.

Action VersionGetResponseRulesSetCacheControlRuleAction

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 VersionGetResponseRulesSetCacheControlRuleActionParametersOptional

The parameters configuring the rule’s action.

Immutable VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableOptional

A cache-control directive configuration.

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirective struct{…}

Set the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersImmutableRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

MaxAge VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeOptional

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

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeSetDirectiveOperation = "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 VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersMaxAgeRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

MustRevalidate VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateOptional

A cache-control directive configuration.

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirective struct{…}

Set the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersMustRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

MustUnderstand VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandOptional

A cache-control directive configuration.

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirective struct{…}

Set the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersMustUnderstandRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

NoCache VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheOptional

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

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirective struct{…}

Set the directive with optional qualifiers.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheSetDirectiveOperation = "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 VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersNoCacheRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

NoStore VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreOptional

A cache-control directive configuration.

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirective struct{…}

Set the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersNoStoreRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

NoTransform VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformOptional

A cache-control directive configuration.

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirective struct{…}

Set the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersNoTransformRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

Private VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateOptional

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

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirective struct{…}

Set the directive with optional qualifiers.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateSetDirectiveOperation = "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 VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersPrivateRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

ProxyRevalidate VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateOptional

A cache-control directive configuration.

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirective struct{…}

Set the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersProxyRevalidateRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

Public VersionGetResponseRulesSetCacheControlRuleActionParametersPublicOptional

A cache-control directive configuration.

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirective struct{…}

Set the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersPublicSetDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

type VersionGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersPublicRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

SMaxage VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageOptional

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

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageSetDirectiveOperation = "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 VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersSMaxageRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

StaleIfError VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorOptional

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

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorSetDirectiveOperation = "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 VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersStaleIfErrorRemoveDirectiveOperation = "remove"
CloudflareOnly boolOptional

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

StaleWhileRevalidate VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateOptional

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

One of the following:
type VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective struct{…}

Set the directive with a duration value in seconds.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirectiveOperation = "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 VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective struct{…}

Remove the directive.

Operation VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation

The operation to perform on the cache-control directive.

One of the following:
const VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationSet VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "set"
const VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperationRemove VersionGetResponseRulesSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirectiveOperation = "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 VersionGetResponseRulesSetCacheControlRuleExposedCredentialCheckOptional

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 VersionGetResponseRulesSetCacheControlRuleRatelimitOptional

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 VersionGetResponseRulesSetCacheSettingsRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesSetCacheTagsRule struct{…}
ID string

The unique ID of the rule.

Action VersionGetResponseRulesSetCacheTagsRuleAction

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 VersionGetResponseRulesSetCacheTagsRuleActionParametersOptional

The parameters configuring the rule’s action.

One of the following:
type VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValues struct{…}

Add cache tags using a list of values.

Operation VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationAdd VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "add"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationRemove VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "remove"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperationSet VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpression struct{…}

Add cache tags using an expression.

Expression string

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

minLength1
Operation VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationAdd VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "add"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationRemove VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "remove"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperationSet VersionGetResponseRulesSetCacheTagsRuleActionParametersAddCacheTagsExpressionOperation = "set"
type VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValues struct{…}

Remove cache tags using a list of values.

Operation VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationAdd VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "add"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationRemove VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "remove"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperationSet VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpression struct{…}

Remove cache tags using an expression.

Expression string

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

minLength1
Operation VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationAdd VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "add"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationRemove VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "remove"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperationSet VersionGetResponseRulesSetCacheTagsRuleActionParametersRemoveCacheTagsExpressionOperation = "set"
type VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValues struct{…}

Set cache tags using a list of values.

Operation VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation

The operation to perform on the cache tags.

One of the following:
const VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationAdd VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "add"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationRemove VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "remove"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperationSet VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsValuesOperation = "set"
Values []string

A list of cache tag values.

type VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpression struct{…}

Set cache tags using an expression.

Expression string

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

minLength1
Operation VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation

The operation to perform on the cache tags.

One of the following:
const VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationAdd VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "add"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationRemove VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "remove"
const VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperationSet VersionGetResponseRulesSetCacheTagsRuleActionParametersSetCacheTagsExpressionOperation = "set"
Categories []stringOptional

The categories of the rule.

Description stringOptional

An informative description of the rule.

ExposedCredentialCheck VersionGetResponseRulesSetCacheTagsRuleExposedCredentialCheckOptional

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 VersionGetResponseRulesSetCacheTagsRuleRatelimitOptional

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 VersionGetResponseRulesSetConfigurationRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesSkipRule struct{…}
ID string
Action string
Enabled bool
Expression string
Ref string
type VersionGetResponseRulesTransformResponseHTMLRule struct{…}
ID string

The unique ID of the rule.

Action VersionGetResponseRulesTransformResponseHTMLRuleAction

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 VersionGetResponseRulesTransformResponseHTMLRuleActionParametersOptional

The parameters configuring the rule’s action.

Categories []stringOptional

The categories of the rule.

Description stringOptional

An informative description of the rule.

ExposedCredentialCheck VersionGetResponseRulesTransformResponseHTMLRuleExposedCredentialCheckOptional

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 VersionGetResponseRulesTransformResponseHTMLRuleRatelimitOptional

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 version

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"),
  )
  version, err := client.Rulesets.Versions.Get(
    context.TODO(),
    "2f2feab2026849078ba485f918791bdc",
    "1",
    rulesets.VersionGetParams{

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