Skip to content
Start here

Zones

List Zones
client.Zones.List(ctx, query) (*V4PagePaginationArray[Zone], error)
GET/zones
Zone Details
client.Zones.Get(ctx, query) (*Zone, error)
GET/zones/{zone_id}
Create Zone
client.Zones.New(ctx, body) (*Zone, error)
POST/zones
Edit Zone
client.Zones.Edit(ctx, params) (*Zone, error)
PATCH/zones/{zone_id}
Delete Zone
client.Zones.Delete(ctx, body) (*ZoneDeleteResponse, error)
DELETE/zones/{zone_id}
ModelsExpand Collapse
type Type string

A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup.

One of the following:
const TypeFull Type = "full"
const TypePartial Type = "partial"
const TypeSecondary Type = "secondary"
const TypeInternal Type = "internal"
type Zone struct{…}
ID string

Identifier

maxLength32
Account ZoneAccount

The account the zone belongs to.

ID stringOptional

Identifier

maxLength32
Name stringOptional

The name of the account.

ActivatedOn Time

The last time proof of ownership was detected and the zone was made active.

formatdate-time
CreatedOn Time

When the zone was created.

formatdate-time
DevelopmentMode float64

The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is 0.

Meta ZoneMeta

Metadata about the zone.

CDNOnly boolOptional

The zone is only configured for CDN.

CustomCertificateQuota int64Optional

Number of Custom Certificates the zone can have.

DNSOnly boolOptional

The zone is only configured for DNS.

FoundationDNS boolOptional

The zone is setup with Foundation DNS.

PageRuleQuota int64Optional

Number of Page Rules a zone can have.

PhishingDetected boolOptional

The zone has been flagged for phishing.

Step int64Optional
ModifiedOn Time

When the zone was last modified.

formatdate-time
Name string

The domain name. Per RFC 1035 the overall zone name can be up to 253 characters, with each segment (“label”) not exceeding 63 characters.

maxLength253
NameServers []string

The name servers Cloudflare assigns to a zone.

OriginalDnshost string

DNS host at the time of switching to Cloudflare.

maxLength50
OriginalNameServers []string

Original name servers before moving to Cloudflare.

OriginalRegistrar string

Registrar for the domain at the time of switching to Cloudflare.

Owner ZoneOwner

The owner of the zone.

ID stringOptional

Identifier

maxLength32
Name stringOptional

Name of the owner.

Type stringOptional

The type of owner.

DeprecatedPlan ZonePlan

Please use the /zones/{zone_id}/subscription API to update a zone’s plan. Changing this value will create/cancel associated subscriptions. To view available plans for this zone, see Zone Plans.

A Zones subscription information.

ID stringOptional

Identifier

maxLength32
CanSubscribe boolOptional

States if the subscription can be activated.

Currency stringOptional

The denomination of the customer.

ExternallyManaged boolOptional

If this Zone is managed by another company.

Frequency stringOptional

How often the customer is billed.

IsSubscribed boolOptional

States if the subscription active.

LegacyDiscount boolOptional

If the legacy discount applies to this Zone.

LegacyID stringOptional

The legacy name of the plan.

Name stringOptional

Name of the owner.

Price float64Optional

How much the customer is paying.

CNAMESuffix stringOptional

Allows the customer to use a custom apex. Tenants Only Configuration.

Paused boolOptional

Indicates whether the zone is only using Cloudflare DNS services. A true value means the zone will not receive security or performance benefits.

DeprecatedPermissions []stringOptional

This has been replaced by Account memberships.

Legacy permissions based on legacy user membership information.

Status ZoneStatusOptional

The zone status on Cloudflare.

One of the following:
const ZoneStatusInitializing ZoneStatus = "initializing"
const ZoneStatusPending ZoneStatus = "pending"
const ZoneStatusActive ZoneStatus = "active"
const ZoneStatusMoved ZoneStatus = "moved"
Tenant ZoneTenantOptional

The root organizational unit that this zone belongs to (such as a tenant or organization).

ID stringOptional

Identifier

maxLength32
Name stringOptional

The name of the Tenant account.

TenantUnit ZoneTenantUnitOptional

The immediate parent organizational unit that this zone belongs to (such as under a tenant or sub-organization).

ID stringOptional

Identifier

maxLength32
Type TypeOptional

A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup.

VanityNameServers []stringOptional

An array of domains used for custom name servers. This is only available for Business and Enterprise plans.

VerificationKey stringOptional

Verification key for partial zone setup.

ZonesActivation Check

Rerun the Activation Check
client.Zones.ActivationCheck.Trigger(ctx, body) (*ActivationCheckTriggerResponse, error)
PUT/zones/{zone_id}/activation_check

ZonesObservability

ZonesObservabilityTracing

ZonesObservabilityTracingSettings

View zone tracing settings
client.Zones.Observability.Tracing.Settings.Get(ctx, query) (*ObservabilityTracingSettingGetResponse, error)
GET/zones/{zone_id}/observability/tracing/settings
Update zone tracing settings
client.Zones.Observability.Tracing.Settings.Update(ctx, params) (*ObservabilityTracingSettingUpdateResponse, error)
PATCH/zones/{zone_id}/observability/tracing/settings
Reset zone tracing settings
client.Zones.Observability.Tracing.Settings.Delete(ctx, body) (*ObservabilityTracingSettingDeleteResponse, error)
DELETE/zones/{zone_id}/observability/tracing/settings

ZonesObservabilityTracingRules

View zone trace rules
client.Zones.Observability.Tracing.Rules.Get(ctx, query) (*ObservabilityTracingRuleGetResponse, error)
GET/zones/{zone_id}/observability/tracing/rules
Replace zone trace rules
client.Zones.Observability.Tracing.Rules.Update(ctx, params) (*ObservabilityTracingRuleUpdateResponse, error)
PUT/zones/{zone_id}/observability/tracing/rules
Delete zone trace rules
client.Zones.Observability.Tracing.Rules.Delete(ctx, body) (*ObservabilityTracingRuleDeleteResponse, error)
DELETE/zones/{zone_id}/observability/tracing/rules

ZonesSettings

Get zone setting
client.Zones.Settings.Get(ctx, settingID, query) (*SettingGetResponse, error)
GET/zones/{zone_id}/settings/{setting_id}
Edit zone setting
client.Zones.Settings.Edit(ctx, settingID, params) (*SettingEditResponse, error)
PATCH/zones/{zone_id}/settings/{setting_id}
ModelsExpand Collapse
type AdvancedDDoS struct{…}

Advanced protection from Distributed Denial of Service (DDoS) attacks on your website. This is an uneditable value that is ‘on’ in the case of Business and Enterprise zones.

ID AdvancedDDoSID

ID of the zone setting.

Value AdvancedDDoSValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type AdvancedDDoSValueArray []string
Editable AdvancedDDoSEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const AdvancedDDoSEditableTrue AdvancedDDoSEditable = true
const AdvancedDDoSEditableFalse AdvancedDDoSEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type AlwaysOnline struct{…}

When enabled, Cloudflare serves limited copies of web pages available from the Internet Archive’s Wayback Machine if your server is offline. Refer to Always Online for more information.

ID AlwaysOnlineID

ID of the zone setting.

Value AlwaysOnlineValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type AlwaysOnlineValueArray []string
Editable AlwaysOnlineEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const AlwaysOnlineEditableTrue AlwaysOnlineEditable = true
const AlwaysOnlineEditableFalse AlwaysOnlineEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type AlwaysUseHTTPS struct{…}
ID AlwaysUseHTTPSIDOptional

If enabled, any http://`` URL is converted to https://` through a 301 redirect.

type AutomaticHTTPSRewrites struct{…}
ID AutomaticHTTPSRewritesIDOptional

Turn on or off Automatic HTTPS Rewrites.

Value AutomaticHTTPSRewritesValueOptional

The status of Automatic HTTPS Rewrites.

One of the following:
const AutomaticHTTPSRewritesValueOn AutomaticHTTPSRewritesValue = "on"
const AutomaticHTTPSRewritesValueOff AutomaticHTTPSRewritesValue = "off"
type AutomaticPlatformOptimization struct{…}
CacheByDeviceType bool

Indicates whether or not cache by device type is enabled.

Cf bool

Indicates whether or not Cloudflare proxy is enabled.

Enabled bool

Indicates whether or not Automatic Platform Optimization is enabled.

Hostnames []string

An array of hostnames where Automatic Platform Optimization for WordPress is activated.

Wordpress bool

Indicates whether or not site is powered by WordPress.

WpPlugin bool

Indicates whether or not Cloudflare for WordPress plugin is installed.

type Brotli struct{…}

When the client requesting an asset supports the Brotli compression algorithm, Cloudflare will serve a Brotli compressed version of the asset.

ID BrotliID

ID of the zone setting.

Value BrotliValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type BrotliValueArray []string
Editable BrotliEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const BrotliEditableTrue BrotliEditable = true
const BrotliEditableFalse BrotliEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type BrowserCacheTTL struct{…}
ID BrowserCacheTTLIDOptional

Control how long resources cached by client browsers remain valid.

Value int64Optional

The number of seconds to cache resources for. Setting this to 0 enables “Respect Existing Headers”.

maximum31536000
minimum0
type BrowserCheck struct{…}
ID BrowserCheckIDOptional

Inspect the visitor’s browser for headers commonly associated with spammers and certain bots.

Value BrowserCheckValueOptional

The status of Browser Integrity Check.

One of the following:
const BrowserCheckValueOn BrowserCheckValue = "on"
const BrowserCheckValueOff BrowserCheckValue = "off"
type CacheLevel struct{…}
ID CacheLevelIDOptional

Apply custom caching based on the option selected.

Value CacheLevelValueOptional
  • bypass: Cloudflare does not cache.
  • basic: Delivers resources from cache when there is no query string.
  • simplified: Delivers the same resource to everyone independent of the query string.
  • aggressive: Caches all static content that has a query string.
  • cache_everything: Treats all content as static and caches all file types beyond the Cloudflare default cached content.
One of the following:
const CacheLevelValueBypass CacheLevelValue = "bypass"
const CacheLevelValueBasic CacheLevelValue = "basic"
const CacheLevelValueSimplified CacheLevelValue = "simplified"
const CacheLevelValueAggressive CacheLevelValue = "aggressive"
const CacheLevelValueCacheEverything CacheLevelValue = "cache_everything"
type ChallengeTTL struct{…}

Specify how long a visitor is allowed access to your site after successfully completing a challenge (such as a CAPTCHA). After the TTL has expired the visitor will have to complete a new challenge. We recommend a 15 - 45 minute setting and will attempt to honor any setting above 45 minutes. (https://support.cloudflare.com/hc/en-us/articles/200170136).

ID ChallengeTTLID

ID of the zone setting.

Value ChallengeTTLValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type ChallengeTTLValueArray []string
Editable ChallengeTTLEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const ChallengeTTLEditableTrue ChallengeTTLEditable = true
const ChallengeTTLEditableFalse ChallengeTTLEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type Ciphers struct{…}

An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.

ID CiphersID

ID of the zone setting.

Value CiphersValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type CiphersValueArray []string
Editable CiphersEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const CiphersEditableTrue CiphersEditable = true
const CiphersEditableFalse CiphersEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type DevelopmentMode struct{…}

Development Mode temporarily allows you to enter development mode for your websites if you need to make changes to your site. This will bypass Cloudflare’s accelerated cache and slow down your site, but is useful if you are making changes to cacheable content (like images, css, or JavaScript) and would like to see those changes right away. Once entered, development mode will last for 3 hours and then automatically toggle off.

ID DevelopmentModeID

ID of the zone setting.

Value DevelopmentModeValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type DevelopmentModeValueArray []string
Editable DevelopmentModeEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const DevelopmentModeEditableTrue DevelopmentModeEditable = true
const DevelopmentModeEditableFalse DevelopmentModeEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
TimeRemaining float64Optional

Value of the zone setting. Notes: The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is false.

type EarlyHints struct{…}

When enabled, Cloudflare will attempt to speed up overall page loads by serving 103 responses with Link headers from the final response. Refer to Early Hints for more information.

ID EarlyHintsID

ID of the zone setting.

Value EarlyHintsValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type EarlyHintsValueArray []string
Editable EarlyHintsEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const EarlyHintsEditableTrue EarlyHintsEditable = true
const EarlyHintsEditableFalse EarlyHintsEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type EmailObfuscation struct{…}
ID EmailObfuscationIDOptional

Turn on or off Email Obfuscation.

Value EmailObfuscationValueOptional

The status of Email Obfuscation.

One of the following:
const EmailObfuscationValueOn EmailObfuscationValue = "on"
const EmailObfuscationValueOff EmailObfuscationValue = "off"
type FontSettings struct{…}

Enhance your website’s font delivery with Cloudflare Fonts. Deliver Google Hosted fonts from your own domain, boost performance, and enhance user privacy. Refer to the Cloudflare Fonts documentation for more information.

ID FontSettingsIDOptional

ID of the zone setting.

Editable FontSettingsEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const FontSettingsEditableTrue FontSettingsEditable = true
const FontSettingsEditableFalse FontSettingsEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
Value FontSettingsValueOptional

Current value of the zone setting.

One of the following:
const FontSettingsValueOn FontSettingsValue = "on"
const FontSettingsValueOff FontSettingsValue = "off"
type H2Prioritization struct{…}

HTTP/2 Edge Prioritization optimises the delivery of resources served through HTTP/2 to improve page load performance. It also supports fine control of content delivery when used in conjunction with Workers.

ID H2PrioritizationID

ID of the zone setting.

Value H2PrioritizationValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type H2PrioritizationValueArray []string
Editable H2PrioritizationEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const H2PrioritizationEditableTrue H2PrioritizationEditable = true
const H2PrioritizationEditableFalse H2PrioritizationEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
One of the following:
One of the following:
type HTTP2 struct{…}

HTTP2 enabled for this zone.

ID HTTP2ID

ID of the zone setting.

Value HTTP2ValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type HTTP2ValueArray []string
Editable HTTP2EditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const HTTP2EditableTrue HTTP2Editable = true
const HTTP2EditableFalse HTTP2Editable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type HTTP3 struct{…}

HTTP3 enabled for this zone.

ID HTTP3ID

ID of the zone setting.

Value HTTP3ValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type HTTP3ValueArray []string
Editable HTTP3EditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const HTTP3EditableTrue HTTP3Editable = true
const HTTP3EditableFalse HTTP3Editable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type ImageResizing struct{…}

Image Transformations provides on-demand resizing, conversion and optimization for images served through Cloudflare’s network. Refer to the Image Transformations documentation for more information.

ID ImageResizingID

ID of the zone setting.

Value ImageResizingValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type ImageResizingValueArray []string
Editable ImageResizingEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const ImageResizingEditableTrue ImageResizingEditable = true
const ImageResizingEditableFalse ImageResizingEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type IPGeolocation struct{…}
ID IPGeolocationIDOptional

Cloudflare adds a CF-IPCountry HTTP header containing the country code that corresponds to the visitor.

Value IPGeolocationValueOptional

The status of adding the IP Geolocation Header.

One of the following:
const IPGeolocationValueOn IPGeolocationValue = "on"
const IPGeolocationValueOff IPGeolocationValue = "off"
type IPV6 struct{…}

Enable IPv6 on all subdomains that are Cloudflare enabled. (https://support.cloudflare.com/hc/en-us/articles/200168586).

ID IPV6ID

ID of the zone setting.

Value IPV6ValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type IPV6ValueArray []string
Editable IPV6EditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const IPV6EditableTrue IPV6Editable = true
const IPV6EditableFalse IPV6Editable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type MinTLSVersion struct{…}

Only accepts HTTPS requests that use at least the TLS protocol version specified. For example, if TLS 1.1 is selected, TLS 1.0 connections will be rejected, while 1.1, 1.2, and 1.3 (if enabled) will be permitted.

ID MinTLSVersionID

ID of the zone setting.

Value MinTLSVersionValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type MinTLSVersionValueArray []string
Editable MinTLSVersionEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const MinTLSVersionEditableTrue MinTLSVersionEditable = true
const MinTLSVersionEditableFalse MinTLSVersionEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type Mirage struct{…}
ID MirageIDOptional

Cloudflare Mirage reduces bandwidth used by images in mobile browsers. It can accelerate loading of image-heavy websites on very slow mobile connections and HTTP/1.

Value MirageValueOptional

The status of Mirage.

One of the following:
const MirageValueOn MirageValue = "on"
const MirageValueOff MirageValue = "off"
type NEL struct{…}

Enable Network Error Logging reporting on your zone. (Beta)

ID NELID

Zone setting identifier.

Value NELValue

Current value of the zone setting.

One of the following:
type NELValueEnabled struct{…}
Enabled boolOptional
type NELValueEnabled struct{…}
Enabled boolOptional
type NELValueEnabled struct{…}
Enabled boolOptional
type NELValueEnabled struct{…}
Enabled boolOptional
type NELValueEnabled struct{…}
Enabled boolOptional
Editable NELEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const NELEditableTrue NELEditable = true
const NELEditableFalse NELEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type OpportunisticEncryption struct{…}
ID OpportunisticEncryptionIDOptional

Opportunistic Encryption allows browsers to access HTTP URIs over an encrypted TLS channel. It’s not a substitute for HTTPS, but provides additional security for otherwise vulnerable requests.

Value OpportunisticEncryptionValueOptional

The status of Opportunistic Encryption.

One of the following:
const OpportunisticEncryptionValueOn OpportunisticEncryptionValue = "on"
const OpportunisticEncryptionValueOff OpportunisticEncryptionValue = "off"
type OpportunisticOnion struct{…}

Add an Alt-Svc header to all legitimate requests from Tor, allowing the connection to use our onion services instead of exit nodes.

ID OpportunisticOnionID

ID of the zone setting.

Value OpportunisticOnionValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type OpportunisticOnionValueArray []string
Editable OpportunisticOnionEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const OpportunisticOnionEditableTrue OpportunisticOnionEditable = true
const OpportunisticOnionEditableFalse OpportunisticOnionEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type OrangeToOrange struct{…}

Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also on Cloudflare.

ID OrangeToOrangeID

ID of the zone setting.

Value OrangeToOrangeValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type OrangeToOrangeValueArray []string
Editable OrangeToOrangeEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const OrangeToOrangeEditableTrue OrangeToOrangeEditable = true
const OrangeToOrangeEditableFalse OrangeToOrangeEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type OriginErrorPagePassThru struct{…}
ID OriginErrorPagePassThruIDOptional

Turn on or off Cloudflare error pages generated from issues sent from the origin server. If enabled, this setting triggers error pages issued by the origin.

Value OriginErrorPagePassThruValueOptional

The status of Origin Error Page Passthru.

One of the following:
const OriginErrorPagePassThruValueOn OriginErrorPagePassThruValue = "on"
const OriginErrorPagePassThruValueOff OriginErrorPagePassThruValue = "off"
type OriginMaxHTTPVersion struct{…}
ID OriginMaxHTTPVersionID

The identifier of the caching setting.

Editable bool

Whether the setting is editable.

Value OriginMaxHTTPVersionValue

Value of the Origin Max HTTP Version Setting.

One of the following:
const OriginMaxHTTPVersionValue2 OriginMaxHTTPVersionValue = "2"
const OriginMaxHTTPVersionValue1 OriginMaxHTTPVersionValue = "1"
ModifiedOn TimeOptional

Last time this setting was modified.

formatdate-time
type Polish struct{…}
ID PolishIDOptional

Apply options from the Polish feature of the Cloudflare Speed app.

Value PolishValueOptional

The level of Polish you want applied to your origin.

One of the following:
const PolishValueOff PolishValue = "off"
const PolishValueLossless PolishValue = "lossless"
const PolishValueLossy PolishValue = "lossy"
type PrefetchPreload struct{…}

Cloudflare will prefetch any URLs that are included in the response headers. This is limited to Enterprise Zones.

ID PrefetchPreloadID

ID of the zone setting.

Value PrefetchPreloadValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type PrefetchPreloadValueArray []string
Editable PrefetchPreloadEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const PrefetchPreloadEditableTrue PrefetchPreloadEditable = true
const PrefetchPreloadEditableFalse PrefetchPreloadEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type ProxyReadTimeout struct{…}

Maximum time between two read operations from origin.

ID ProxyReadTimeoutID

ID of the zone setting.

Value ProxyReadTimeoutValueUnion

Value of the zone setting. Notes: Value must be between 1 and 6000

One of the following:
UnionString
UnionFloat
UnionBool
type ProxyReadTimeoutValueArray []string
Editable ProxyReadTimeoutEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const ProxyReadTimeoutEditableTrue ProxyReadTimeoutEditable = true
const ProxyReadTimeoutEditableFalse ProxyReadTimeoutEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type PseudoIPV4 struct{…}

The value set for the Pseudo IPv4 setting.

ID PseudoIPV4ID

Value of the Pseudo IPv4 setting.

Value PseudoIPV4ValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type PseudoIPV4ValueArray []string
Editable PseudoIPV4EditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const PseudoIPV4EditableTrue PseudoIPV4Editable = true
const PseudoIPV4EditableFalse PseudoIPV4Editable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type ResponseBuffering struct{…}
ID ResponseBufferingIDOptional

Turn on or off whether Cloudflare should wait for an entire file from the origin server before forwarding it to the site visitor. By default, Cloudflare sends packets to the client as they arrive from the origin server.

Value ResponseBufferingValueOptional

The status of Response Buffering

One of the following:
const ResponseBufferingValueOn ResponseBufferingValue = "on"
const ResponseBufferingValueOff ResponseBufferingValue = "off"
type RocketLoader struct{…}
ID RocketLoaderIDOptional

Turn on or off Rocket Loader in the Cloudflare Speed app.

Value RocketLoaderValueOptional

The status of Rocket Loader

One of the following:
const RocketLoaderValueOn RocketLoaderValue = "on"
const RocketLoaderValueOff RocketLoaderValue = "off"
type SecurityHeaders struct{…}

Cloudflare security header for a zone.

ID SecurityHeadersID

ID of the zone’s security header.

Value SecurityHeadersValue

Current value of the zone setting.

One of the following:
type SecurityHeadersValueStrictTransportSecurity struct{…}
StrictTransportSecurity SecurityHeadersValueStrictTransportSecurityStrictTransportSecurityOptional

Strict Transport Security.

Enabled boolOptional

Whether or not strict transport security is enabled.

IncludeSubdomains boolOptional

Include all subdomains for strict transport security.

MaxAge float64Optional

Max age in seconds of the strict transport security.

Nosniff boolOptional

Whether or not to include ‘X-Content-Type-Options: nosniff’ header.

Preload boolOptional

Enable automatic preload of the HSTS configuration.

type SecurityHeadersValueStrictTransportSecurity struct{…}
StrictTransportSecurity SecurityHeadersValueStrictTransportSecurityStrictTransportSecurityOptional

Strict Transport Security.

Enabled boolOptional

Whether or not strict transport security is enabled.

IncludeSubdomains boolOptional

Include all subdomains for strict transport security.

MaxAge float64Optional

Max age in seconds of the strict transport security.

Nosniff boolOptional

Whether or not to include ‘X-Content-Type-Options: nosniff’ header.

Preload boolOptional

Enable automatic preload of the HSTS configuration.

type SecurityHeadersValueStrictTransportSecurity struct{…}
StrictTransportSecurity SecurityHeadersValueStrictTransportSecurityStrictTransportSecurityOptional

Strict Transport Security.

Enabled boolOptional

Whether or not strict transport security is enabled.

IncludeSubdomains boolOptional

Include all subdomains for strict transport security.

MaxAge float64Optional

Max age in seconds of the strict transport security.

Nosniff boolOptional

Whether or not to include ‘X-Content-Type-Options: nosniff’ header.

Preload boolOptional

Enable automatic preload of the HSTS configuration.

type SecurityHeadersValueStrictTransportSecurity struct{…}
StrictTransportSecurity SecurityHeadersValueStrictTransportSecurityStrictTransportSecurityOptional

Strict Transport Security.

Enabled boolOptional

Whether or not strict transport security is enabled.

IncludeSubdomains boolOptional

Include all subdomains for strict transport security.

MaxAge float64Optional

Max age in seconds of the strict transport security.

Nosniff boolOptional

Whether or not to include ‘X-Content-Type-Options: nosniff’ header.

Preload boolOptional

Enable automatic preload of the HSTS configuration.

type SecurityHeadersValueStrictTransportSecurity struct{…}
StrictTransportSecurity SecurityHeadersValueStrictTransportSecurityStrictTransportSecurityOptional

Strict Transport Security.

Enabled boolOptional

Whether or not strict transport security is enabled.

IncludeSubdomains boolOptional

Include all subdomains for strict transport security.

MaxAge float64Optional

Max age in seconds of the strict transport security.

Nosniff boolOptional

Whether or not to include ‘X-Content-Type-Options: nosniff’ header.

Preload boolOptional

Enable automatic preload of the HSTS configuration.

Editable SecurityHeadersEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const SecurityHeadersEditableTrue SecurityHeadersEditable = true
const SecurityHeadersEditableFalse SecurityHeadersEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type SecurityLevel struct{…}
ID SecurityLevelIDOptional

Control options for the Security Level feature from the Security app.

Value SecurityLevelValueOptional
One of the following:
const SecurityLevelValueOff SecurityLevelValue = "off"
const SecurityLevelValueEssentiallyOff SecurityLevelValue = "essentially_off"
const SecurityLevelValueLow SecurityLevelValue = "low"
const SecurityLevelValueMedium SecurityLevelValue = "medium"
const SecurityLevelValueHigh SecurityLevelValue = "high"
const SecurityLevelValueUnderAttack SecurityLevelValue = "under_attack"
type ServerSideExcludes struct{…}

If there is sensitive content on your website that you want visible to real visitors, but that you want to hide from suspicious visitors, all you have to do is wrap the content with Cloudflare SSE tags. Wrap any content that you want to be excluded from suspicious visitors in the following SSE tags: . For example: Bad visitors won’t see my phone number, 555-555-5555 . Note: SSE only will work with HTML. If you have HTML minification enabled, you won’t see the SSE tags in your HTML source when it’s served through Cloudflare. SSE will still function in this case, as Cloudflare’s HTML minification and SSE functionality occur on-the-fly as the resource moves through our network to the visitor’s computer. (https://support.cloudflare.com/hc/en-us/articles/200170036).

ID ServerSideExcludesID

ID of the zone setting.

Value ServerSideExcludesValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type ServerSideExcludesValueArray []string
Editable ServerSideExcludesEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const ServerSideExcludesEditableTrue ServerSideExcludesEditable = true
const ServerSideExcludesEditableFalse ServerSideExcludesEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type SortQueryStringForCache struct{…}
ID SortQueryStringForCacheIDOptional

Turn on or off the reordering of query strings. When query strings have the same structure, caching improves.

Value SortQueryStringForCacheValueOptional

The status of Query String Sort

One of the following:
const SortQueryStringForCacheValueOn SortQueryStringForCacheValue = "on"
const SortQueryStringForCacheValueOff SortQueryStringForCacheValue = "off"
type SSL struct{…}
ID SSLIDOptional

Control options for the SSL feature of the Edge Certificates tab in the Cloudflare SSL/TLS app.

Value SSLValueOptional

The encryption mode that Cloudflare uses to connect to your origin server.

One of the following:
const SSLValueOff SSLValue = "off"
const SSLValueFlexible SSLValue = "flexible"
const SSLValueFull SSLValue = "full"
const SSLValueStrict SSLValue = "strict"
const SSLValueOriginPull SSLValue = "origin_pull"
type SSLRecommender struct{…}

Enrollment in the SSL/TLS Recommender service which tries to detect and recommend (by sending periodic emails) the most secure SSL/TLS setting your origin servers support.

ID SSLRecommenderIDOptional

Enrollment value for SSL/TLS Recommender.

Enabled boolOptional

ssl-recommender enrollment setting.

type TLS1_3 struct{…}

Enables Crypto TLS 1.3 feature for a zone.

ID TLS1_3ID

ID of the zone setting.

Value TLS1_3ValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type TLS1_3ValueArray []string
Editable TLS1_3EditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const TLS1_3EditableTrue TLS1_3Editable = true
const TLS1_3EditableFalse TLS1_3Editable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type TLSClientAuth struct{…}

TLS Client Auth requires Cloudflare to connect to your origin server using a client certificate (Enterprise Only).

ID TLSClientAuthID

ID of the zone setting.

Value TLSClientAuthValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type TLSClientAuthValueArray []string
Editable TLSClientAuthEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const TLSClientAuthEditableTrue TLSClientAuthEditable = true
const TLSClientAuthEditableFalse TLSClientAuthEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type TrueClientIPHeader struct{…}
ID TrueClientIPHeaderIDOptional

Turn on or off the True-Client-IP Header feature of the Cloudflare Network app.

Value TrueClientIPHeaderValueOptional

The status of True Client IP Header.

One of the following:
const TrueClientIPHeaderValueOn TrueClientIPHeaderValue = "on"
const TrueClientIPHeaderValueOff TrueClientIPHeaderValue = "off"
type WAF struct{…}
ID WAFIDOptional

Turn on or off WAF managed rules (previous version, deprecated). You cannot enable or disable individual WAF managed rules via Page Rules.

Value WAFValueOptional

The status of WAF managed rules (previous version).

One of the following:
const WAFValueOn WAFValue = "on"
const WAFValueOff WAFValue = "off"
type WebP struct{…}

When the client requesting the image supports the WebP image codec, and WebP offers a performance advantage over the original image format, Cloudflare will serve a WebP version of the original image.

ID WebPID

ID of the zone setting.

Value WebPValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type WebPValueArray []string
Editable WebPEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const WebPEditableTrue WebPEditable = true
const WebPEditableFalse WebPEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type Websocket struct{…}

WebSockets are open connections sustained between the client and the origin server. Inside a WebSockets connection, the client and the origin can pass data back and forth without having to reestablish sessions. This makes exchanging data within a WebSockets connection fast. WebSockets are often used for real-time applications such as live chat and gaming. For more information refer to Can I use Cloudflare with Websockets.

ID WebsocketID

ID of the zone setting.

Value WebsocketValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type WebsocketValueArray []string
Editable WebsocketEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const WebsocketEditableTrue WebsocketEditable = true
const WebsocketEditableFalse WebsocketEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
type ZeroRTT struct{…}

0-RTT session resumption enabled for this zone.

ID ZeroRTTID

ID of the zone setting.

Value ZeroRTTValueUnion

Current value of the zone setting.

One of the following:
UnionString
UnionFloat
UnionBool
type ZeroRTTValueArray []string
Editable ZeroRTTEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const ZeroRTTEditableTrue ZeroRTTEditable = true
const ZeroRTTEditableFalse ZeroRTTEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time

ZonesTransformations Allowed Origins

Get Image Transformations Allowed Origins setting
client.Zones.TransformationsAllowedOrigins.Get(ctx, query) (*TransformationsAllowedOrigins, error)
GET/zones/{zone_id}/settings/transformations_allowed_origins
Change Image Transformations Allowed Origins setting
client.Zones.TransformationsAllowedOrigins.Edit(ctx, params) (*TransformationsAllowedOrigins, error)
PATCH/zones/{zone_id}/settings/transformations_allowed_origins
ModelsExpand Collapse
type TransformationsAllowedOrigins struct{…}

Controls which origins are allowed to request image and video transformations.

ID TransformationsAllowedOriginsIDOptional

ID of the zone setting.

Editable TransformationsAllowedOriginsEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const TransformationsAllowedOriginsEditableTrue TransformationsAllowedOriginsEditable = true
const TransformationsAllowedOriginsEditableFalse TransformationsAllowedOriginsEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
Value TransformationsAllowedOriginsValueOptional

Comma-separated list of allowed origin domains for image and video transformations. Use ”*” to allow all origins (default).

One of the following:
const TransformationsAllowedOriginsValueOn TransformationsAllowedOriginsValue = "on"
const TransformationsAllowedOriginsValueOff TransformationsAllowedOriginsValue = "off"

ZonesTransformations C2pa

Get Image Transformations C2PA setting
client.Zones.TransformationsC2pa.Get(ctx, query) (*TransformationsC2pa, error)
GET/zones/{zone_id}/settings/transformations_c2pa
Change Image Transformations C2PA setting
client.Zones.TransformationsC2pa.Edit(ctx, params) (*TransformationsC2pa, error)
PATCH/zones/{zone_id}/settings/transformations_c2pa
ModelsExpand Collapse
type TransformationsC2pa struct{…}

Controls C2PA signing for images processed through Cloudflare Image Transformations.

ID TransformationsC2paIDOptional

ID of the zone setting.

Editable TransformationsC2paEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:
const TransformationsC2paEditableTrue TransformationsC2paEditable = true
const TransformationsC2paEditableFalse TransformationsC2paEditable = false
ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time
Value TransformationsC2paValueOptional

Current value of the zone setting.

One of the following:
const TransformationsC2paValueOn TransformationsC2paValue = "on"
const TransformationsC2paValueOff TransformationsC2paValue = "off"

ZonesNEL

Get NEL setting
client.Zones.NEL.Get(ctx, query) (*Setting, error)
GET/zones/{zone_id}/settings/nel
Edit NEL setting
client.Zones.NEL.Edit(ctx, params) (*Setting, error)
PATCH/zones/{zone_id}/settings/nel
ModelsExpand Collapse
type Setting struct{…}

A zone-scoped NEL configuration setting.

ID SettingID

Zone setting identifier.

Editable bool

Whether the setting is editable. This is false when the zone’s plan does not include NEL or the NEL product feature is not enabled.

ModifiedOn Time

When the setting was last modified. A zero value (0001-01-01T00:00:00Z) indicates the setting has never been explicitly set and is using the default value.

formatdate-time
Value SettingValue

The NEL configuration value.

Enabled bool

Whether Network Error Logging is enabled for the zone. When enabled, browsers report network errors to Cloudflare’s NEL endpoint.

ZonesEnvironments

List zone environments
client.Zones.Environments.List(ctx, query) (*EnvironmentListResponse, error)
GET/zones/{zone_id}/environments
Create zone environments
client.Zones.Environments.New(ctx, params) (*EnvironmentNewResponse, error)
POST/zones/{zone_id}/environments
Upsert zone environments
client.Zones.Environments.Update(ctx, params) (*EnvironmentUpdateResponse, error)
PUT/zones/{zone_id}/environments
Partially update zone environments
client.Zones.Environments.Edit(ctx, params) (*EnvironmentEditResponse, error)
PATCH/zones/{zone_id}/environments
Delete zone environment
client.Zones.Environments.Delete(ctx, environmentID, body) (*EnvironmentDeleteResponse, error)
DELETE/zones/{zone_id}/environments/{environment_id}
Roll back zone environment
client.Zones.Environments.Rollback(ctx, environmentID, body) (*EnvironmentRollbackResponse, error)
POST/zones/{zone_id}/environments/{environment_id}/rollback

ZonesCustom Nameservers

Get Account Custom Nameserver Related Zone Metadata
Deprecated
client.Zones.CustomNameservers.Get(ctx, query) (*CustomNameserverGetResponse, error)
GET/zones/{zone_id}/custom_ns
Set Account Custom Nameserver Related Zone Metadata
Deprecated
client.Zones.CustomNameservers.Update(ctx, params) (*SinglePage[string], error)
PUT/zones/{zone_id}/custom_ns

ZonesHolds

Get Zone Hold
client.Zones.Holds.Get(ctx, query) (*ZoneHold, error)
GET/zones/{zone_id}/hold
Create Zone Hold
client.Zones.Holds.New(ctx, params) (*ZoneHold, error)
POST/zones/{zone_id}/hold
Update Zone Hold
client.Zones.Holds.Edit(ctx, params) (*ZoneHold, error)
PATCH/zones/{zone_id}/hold
Remove Zone Hold
client.Zones.Holds.Delete(ctx, params) (*ZoneHold, error)
DELETE/zones/{zone_id}/hold
ModelsExpand Collapse
type ZoneHold struct{…}
Hold boolOptional
HoldAfter stringOptional
IncludeSubdomains stringOptional

ZonesSubscriptions

Zone Subscription Details
client.Zones.Subscriptions.Get(ctx, query) (*SubscriptionGetResponse, error)
GET/zones/{zone_id}/subscription
Create Zone Subscription
client.Zones.Subscriptions.New(ctx, params) (*SubscriptionNewResponse, error)
POST/zones/{zone_id}/subscription
Update Zone Subscription
client.Zones.Subscriptions.Update(ctx, params) (*SubscriptionUpdateResponse, error)
PUT/zones/{zone_id}/subscription

ZonesPlans

List Available Plans
client.Zones.Plans.List(ctx, query) (*SinglePage[AvailableRatePlan], error)
GET/zones/{zone_id}/available_plans
Available Plan Details
client.Zones.Plans.Get(ctx, planIdentifier, query) (*AvailableRatePlan, error)
GET/zones/{zone_id}/available_plans/{plan_identifier}
ModelsExpand Collapse
type AvailableRatePlan struct{…}
ID stringOptional

Identifier

maxLength32
CanSubscribe boolOptional

Indicates whether you can subscribe to this plan.

Currency stringOptional

The monetary unit in which pricing information is displayed.

ExternallyManaged boolOptional

Indicates whether this plan is managed externally.

Frequency AvailableRatePlanFrequencyOptional

The frequency at which you will be billed for this plan.

One of the following:
const AvailableRatePlanFrequencyWeekly AvailableRatePlanFrequency = "weekly"
const AvailableRatePlanFrequencyMonthly AvailableRatePlanFrequency = "monthly"
const AvailableRatePlanFrequencyQuarterly AvailableRatePlanFrequency = "quarterly"
const AvailableRatePlanFrequencyYearly AvailableRatePlanFrequency = "yearly"
IsSubscribed boolOptional

Indicates whether you are currently subscribed to this plan.

LegacyID stringOptional

The legacy identifier for this rate plan, if any.

Name stringOptional

The plan name.

maxLength80
Price float64Optional

The amount you will be billed for this plan.

ZonesRate Plans

List Available Rate Plans
client.Zones.RatePlans.Get(ctx, query) (*SinglePage[RatePlanGetResponse], error)
GET/zones/{zone_id}/available_rate_plans

ZonesOhttp Gateway

Get OHTTP Gateway enablement
client.Zones.OhttpGateway.Get(ctx, query) (*OhttpGatewayGetResponse, error)
GET/zones/{zone_id}/settings/ohttp-gateway
Enable OHTTP Gateway
client.Zones.OhttpGateway.New(ctx, body) (*OhttpGatewayNewResponse, error)
PUT/zones/{zone_id}/settings/ohttp-gateway
Disable OHTTP Gateway
client.Zones.OhttpGateway.Delete(ctx, body) (*OhttpGatewayDeleteResponse, error)
DELETE/zones/{zone_id}/settings/ohttp-gateway

ZonesEntitlements

Get Zone Entitlements
client.Zones.Entitlements.List(ctx, query) (*SinglePage[EntitlementListResponse], error)
GET/zones/{zone_id}/entitlements

ZonesCT

ZonesCTAlerting

Get CT Alerting Subscription
client.Zones.CT.Alerting.Get(ctx, query) (*CTAlertingSubscription, error)
GET/zones/{zone_id}/ct/alerting
Update CT Alerting Subscription
client.Zones.CT.Alerting.Edit(ctx, params) (*CTAlertingSubscription, error)
PATCH/zones/{zone_id}/ct/alerting
ModelsExpand Collapse
type CTAlertingSubscription struct{…}

Certificate Transparency alerting subscription settings for a zone.

Enabled bool

Whether CT alerting is enabled for the zone.

Emails []stringOptional

Email addresses that receive CT alert notifications for the zone. A maximum of 100 addresses may be configured. Each address must be a valid RFC 5322 email address and must not contain a comma. Omitted from responses when no addresses are configured.