Skip to content
Start here

Gateway

Get Zero Trust account information
GET/accounts/{account_id}/gateway
Create Zero Trust account
POST/accounts/{account_id}/gateway
ModelsExpand Collapse
GatewayListResponse { id, gateway_tag, provider_name }
id: optional string

Specify the Cloudflare account ID.

maxLength32
gateway_tag: optional string

Specify the gateway internal ID.

maxLength32
provider_name: optional string

Specify the provider name (usually Cloudflare).

GatewayCreateResponse { id, gateway_tag, provider_name }
id: optional string

Specify the Cloudflare account ID.

maxLength32
gateway_tag: optional string

Specify the gateway internal ID.

maxLength32
provider_name: optional string

Specify the provider name (usually Cloudflare).

GatewayAudit SSH Settings

Get Zero Trust SSH settings
GET/accounts/{account_id}/gateway/audit_ssh_settings
Update Zero Trust SSH settings
PUT/accounts/{account_id}/gateway/audit_ssh_settings
Rotate Zero Trust SSH account seed
POST/accounts/{account_id}/gateway/audit_ssh_settings/rotate_seed
ModelsExpand Collapse
GatewaySettings { created_at, public_key, seed_id, updated_at }
created_at: optional string
formatdate-time
public_key: optional string
seed_id: optional string

Identify the seed ID.

maxLength36
updated_at: optional string
formatdate-time

GatewayCategories

List categories
GET/accounts/{account_id}/gateway/categories
ModelsExpand Collapse
Category { id, beta, class, 3 more }
id: optional number

Identify this category. Only one category per ID.

beta: optional boolean

Indicate whether the category is in beta and subject to change.

class: optional "free" or "premium" or "blocked" or 2 more

Specify which account types can create policies for this category. blocked Blocks unconditionally for all accounts. removalPending Allows removal from policies but disables addition. noBlock Prevents blocking.

One of the following:
"free"
"premium"
"blocked"
"removalPending"
"noBlock"
description: optional string

Provide a short summary of domains in the category.

name: optional string

Specify the category name.

subcategories: optional array of { id, beta, class, 2 more }

Provide all subcategories for this category.

id: optional number

Identify this category. Only one category per ID.

beta: optional boolean

Indicate whether the category is in beta and subject to change.

class: optional "free" or "premium" or "blocked" or 2 more

Specify which account types can create policies for this category. blocked Blocks unconditionally for all accounts. removalPending Allows removal from policies but disables addition. noBlock Prevents blocking.

One of the following:
"free"
"premium"
"blocked"
"removalPending"
"noBlock"
description: optional string

Provide a short summary of domains in the category.

name: optional string

Specify the category name.

GatewayApp Types

List application and application type mappings
GET/accounts/{account_id}/gateway/app_types
ModelsExpand Collapse
AppType = { id, application_type_id, created_at, name } or { id, created_at, description, name }
One of the following:
ZeroTrustGatewayApplication { id, application_type_id, created_at, name }
id: optional number

Identify this application. Only one application per ID.

application_type_id: optional number

Identify the type of this application. Multiple applications can share the same type. Refers to the id of a returned application type.

created_at: optional string
formatdate-time
name: optional string

Specify the name of the application or application type.

ZeroTrustGatewayApplicationType { id, created_at, description, name }
id: optional number

Identify the type of this application. Multiple applications can share the same type. Refers to the id of a returned application type.

created_at: optional string
formatdate-time
description: optional string

Provide a short summary of applications with this type.

name: optional string

Specify the name of the application or application type.

GatewayConfigurations

Get Zero Trust account configuration
GET/accounts/{account_id}/gateway/configuration
Update Zero Trust account configuration
PUT/accounts/{account_id}/gateway/configuration
Patch Zero Trust account configuration
PATCH/accounts/{account_id}/gateway/configuration
ModelsExpand Collapse
ActivityLogSettings { enabled }

Specify activity log settings.

enabled: optional boolean

Specify whether to log activity.

AntiVirusSettings { enabled_download_phase, enabled_upload_phase, fail_closed, notification_settings }

Specify anti-virus settings.

enabled_download_phase: optional boolean

Specify whether to enable anti-virus scanning on downloads.

enabled_upload_phase: optional boolean

Specify whether to enable anti-virus scanning on uploads.

fail_closed: optional boolean

Specify whether to block requests for unscannable files.

notification_settings: optional NotificationSettings { enabled, include_context, msg, support_url }

Configure the message the user’s device shows during an antivirus scan.

BlockPageSettings { background_color, enabled, footer_text, 12 more }

Specify block page layout settings.

background_color: optional string

Specify the block page background color in #rrggbb format when the mode is customized_block_page.

enabled: optional boolean

Specify whether to enable the custom block page.

header_text: optional string

Specify the block page header text when the mode is customized_block_page.

include_context: optional boolean

Specify whether to append context to target_uri as query parameters. This applies only when the mode is redirect_uri.

logo_path: optional string

Specify the full URL to the logo file when the mode is customized_block_page.

mailto_address: optional string

Specify the admin email for users to contact when the mode is customized_block_page.

mailto_subject: optional string

Specify the subject line for emails created from the block page when the mode is customized_block_page.

mode: optional "" or "customized_block_page" or "redirect_uri"

Specify whether to redirect users to a Cloudflare-hosted block page or a customer-provided URI.

One of the following:
""
"customized_block_page"
"redirect_uri"
name: optional string

Specify the block page title when the mode is customized_block_page.

read_only: optional boolean

Indicate that this setting was shared via the Orgs API and read only for the current account.

source_account: optional string

Indicate the account tag of the account that shared this setting.

target_uri: optional string

Specify the URI to redirect users to when the mode is redirect_uri.

formaturi
version: optional number

Indicate the version number of the setting.

BodyScanningSettings { inspection_mode }

Specify the DLP inspection mode.

inspection_mode: optional "deep" or "shallow"

Specify the inspection mode as either deep or shallow.

One of the following:
"deep"
"shallow"
BrowserIsolationSettings { non_identity_enabled, url_browser_isolation_enabled }

Specify Clientless Browser Isolation settings.

non_identity_enabled: optional boolean

Specify whether to enable non-identity onramp support for Browser Isolation.

url_browser_isolation_enabled: optional boolean

Specify whether to enable Clientless Browser Isolation.

CustomCertificateSettings { enabled, id, binding_status, updated_at }

Specify custom certificate settings for BYO-PKI. This field is deprecated; use certificate instead.

enabled: boolean

Specify whether to enable a custom certificate authority for signing Gateway traffic.

id: optional string

Specify the UUID of the certificate (ID from MTLS certificate store).

binding_status: optional string

Indicate the internal certificate status.

updated_at: optional string
formatdate-time
ExtendedEmailMatching { enabled, read_only, source_account, version }

Configures user email settings for firewall policies. When you enable this, the system standardizes email addresses in the identity portion of the rule to match extended email variants in firewall policies. When you disable this setting, the system matches email addresses exactly as you provide them. Enable this setting if your email uses . or + modifiers.

enabled: optional boolean

Specify whether to match all variants of user emails (with + or . modifiers) used as criteria in Firewall policies.

read_only: optional boolean

Indicate that this setting was shared via the Orgs API and read only for the current account.

source_account: optional string

Indicate the account tag of the account that shared this setting.

version: optional number

Indicate the version number of the setting.

FipsSettings { tls }

Specify FIPS settings.

tls: optional boolean

Enforce cipher suites and TLS versions compliant with FIPS 140-2.

GatewayConfigurationSettings { activity_log, antivirus, block_page, 11 more }

Specify account settings.

activity_log: optional ActivityLogSettings { enabled }

Specify activity log settings.

antivirus: optional AntiVirusSettings { enabled_download_phase, enabled_upload_phase, fail_closed, notification_settings }

Specify anti-virus settings.

block_page: optional BlockPageSettings { background_color, enabled, footer_text, 12 more }

Specify block page layout settings.

body_scanning: optional BodyScanningSettings { inspection_mode }

Specify the DLP inspection mode.

browser_isolation: optional BrowserIsolationSettings { non_identity_enabled, url_browser_isolation_enabled }

Specify Clientless Browser Isolation settings.

certificate: optional { id }

Specify certificate settings for Gateway TLS interception. If unset, the Cloudflare Root CA handles interception.

id: string

Specify the UUID of the certificate used for interception. Ensure the certificate is available at the edge(previously called ‘active’). A nil UUID directs Cloudflare to use the Root CA.

Deprecatedcustom_certificate: optional CustomCertificateSettings { enabled, id, binding_status, updated_at }

Specify custom certificate settings for BYO-PKI. This field is deprecated; use certificate instead.

extended_email_matching: optional ExtendedEmailMatching { enabled, read_only, source_account, version }

Configures user email settings for firewall policies. When you enable this, the system standardizes email addresses in the identity portion of the rule to match extended email variants in firewall policies. When you disable this setting, the system matches email addresses exactly as you provide them. Enable this setting if your email uses . or + modifiers.

fips: optional FipsSettings { tls }

Specify FIPS settings.

host_selector: optional { enabled }

Enable host selection in egress policies.

enabled: optional boolean

Specify whether to enable filtering via hosts for egress policies.

inspection: optional { mode }

Define the proxy inspection mode.

mode: optional "static" or "dynamic"

Define the proxy inspection mode. 1. static: Gateway applies static inspection to HTTP on TCP(80). With TLS decryption on, Gateway inspects HTTPS traffic on TCP(443) and UDP(443). 2. dynamic: Gateway applies protocol detection to inspect HTTP and HTTPS traffic on any port. TLS decryption must remain on to inspect HTTPS traffic.

One of the following:
"static"
"dynamic"
protocol_detection: optional ProtocolDetection { enabled }

Specify whether to detect protocols from the initial bytes of client traffic.

sandbox: optional { enabled, fallback_action }

Specify whether to enable the sandbox.

enabled: optional boolean

Specify whether to enable the sandbox.

fallback_action: optional "allow" or "block"

Specify the action to take when the system cannot scan the file.

One of the following:
"allow"
"block"
tls_decrypt: optional TLSSettings { enabled }

Specify whether to inspect encrypted HTTP traffic.

NotificationSettings { enabled, include_context, msg, support_url }

Configure the message the user’s device shows during an antivirus scan.

enabled: optional boolean

Specify whether to enable notifications.

include_context: optional boolean

Specify whether to include context information as query parameters.

msg: optional string

Specify the message to show in the notification.

support_url: optional string

Specify a URL that directs users to more information. If unset, the notification opens a block page.

ProtocolDetection { enabled }

Specify whether to detect protocols from the initial bytes of client traffic.

enabled: optional boolean

Specify whether to detect protocols from the initial bytes of client traffic.

TLSSettings { enabled }

Specify whether to inspect encrypted HTTP traffic.

enabled: optional boolean

Specify whether to inspect encrypted HTTP traffic.

ConfigurationGetResponse { created_at, settings, updated_at }

Specify account settings.

created_at: optional string
formatdate-time
settings: optional GatewayConfigurationSettings { activity_log, antivirus, block_page, 11 more }

Specify account settings.

updated_at: optional string
formatdate-time
ConfigurationUpdateResponse { created_at, settings, updated_at }

Specify account settings.

created_at: optional string
formatdate-time
settings: optional GatewayConfigurationSettings { activity_log, antivirus, block_page, 11 more }

Specify account settings.

updated_at: optional string
formatdate-time
ConfigurationEditResponse { created_at, settings, updated_at }

Specify account settings.

created_at: optional string
formatdate-time
settings: optional GatewayConfigurationSettings { activity_log, antivirus, block_page, 11 more }

Specify account settings.

updated_at: optional string
formatdate-time

GatewayConfigurationsCustom Certificate

Get Zero Trust certificate configuration
Deprecated
GET/accounts/{account_id}/gateway/configuration/custom_certificate

GatewayLists

List Zero Trust lists
GET/accounts/{account_id}/gateway/lists
Get Zero Trust list details
GET/accounts/{account_id}/gateway/lists/{list_id}
Create Zero Trust list
POST/accounts/{account_id}/gateway/lists
Update Zero Trust list
PUT/accounts/{account_id}/gateway/lists/{list_id}
Patch Zero Trust list.
PATCH/accounts/{account_id}/gateway/lists/{list_id}
Delete Zero Trust list
DELETE/accounts/{account_id}/gateway/lists/{list_id}
ModelsExpand Collapse
GatewayItem { created_at, description, value }
created_at: optional string
formatdate-time
description: optional string

Provide the list item description (optional).

minimum0
value: optional string

Specify the item value.

GatewayList { id, count, created_at, 5 more }
id: optional string

Identify the API resource with a UUID.

maxLength36
count: optional number

Indicate the number of items in the list.

created_at: optional string
formatdate-time
description: optional string

Provide the list description.

items: optional array of GatewayItem { created_at, description, value }

Provide the list items.

created_at: optional string
formatdate-time
description: optional string

Provide the list item description (optional).

minimum0
value: optional string

Specify the item value.

name: optional string

Specify the list name.

type: optional "SERIAL" or "URL" or "DOMAIN" or 5 more

Specify the list type.

One of the following:
"SERIAL"
"URL"
"DOMAIN"
"EMAIL"
"IP"
"CATEGORY"
"LOCATION"
"DEVICE"
updated_at: optional string
formatdate-time
ListCreateResponse { id, created_at, description, 4 more }
id: optional string

Identify the API resource with a UUID.

maxLength36
created_at: optional string
formatdate-time
description: optional string

Provide the list description.

items: optional array of GatewayItem { created_at, description, value }

Provide the list items.

created_at: optional string
formatdate-time
description: optional string

Provide the list item description (optional).

minimum0
value: optional string

Specify the item value.

name: optional string

Specify the list name.

type: optional "SERIAL" or "URL" or "DOMAIN" or 5 more

Specify the list type.

One of the following:
"SERIAL"
"URL"
"DOMAIN"
"EMAIL"
"IP"
"CATEGORY"
"LOCATION"
"DEVICE"
updated_at: optional string
formatdate-time
ListDeleteResponse = unknown

GatewayListsItems

Get Zero Trust list items
GET/accounts/{account_id}/gateway/lists/{list_id}/items
ModelsExpand Collapse
ItemListResponse = array of GatewayItem { created_at, description, value }

Provide the list items.

created_at: optional string
formatdate-time
description: optional string

Provide the list item description (optional).

minimum0
value: optional string

Specify the item value.

GatewayLocations

List Zero Trust Gateway locations
GET/accounts/{account_id}/gateway/locations
Get Zero Trust Gateway location details
GET/accounts/{account_id}/gateway/locations/{location_id}
Create a Zero Trust Gateway location
POST/accounts/{account_id}/gateway/locations
Update a Zero Trust Gateway location
PUT/accounts/{account_id}/gateway/locations/{location_id}
Delete a Zero Trust Gateway location
DELETE/accounts/{account_id}/gateway/locations/{location_id}
ModelsExpand Collapse
DOHEndpoint { enabled, networks, require_token }
enabled: optional boolean

Indicate whether the DOH endpoint is enabled for this location.

networks: optional array of IPNetwork { network }

Specify the list of allowed source IP network ranges for this endpoint. When the list is empty, the endpoint allows all source IPs. The list takes effect only if the endpoint is enabled for this location.

network: string

Specify the IP address or IP CIDR.

require_token: optional boolean

Specify whether the DOH endpoint requires user identity authentication.

DOTEndpoint { enabled, networks }
enabled: optional boolean

Indicate whether the DOT endpoint is enabled for this location.

networks: optional array of IPNetwork { network }

Specify the list of allowed source IP network ranges for this endpoint. When the list is empty, the endpoint allows all source IPs. The list takes effect only if the endpoint is enabled for this location.

network: string

Specify the IP address or IP CIDR.

Endpoint { doh, dot, ipv4, ipv6 }

Configure the destination endpoints for this location.

doh: DOHEndpoint { enabled, networks, require_token }
dot: DOTEndpoint { enabled, networks }
ipv4: IPV4Endpoint { enabled }
ipv6: IPV6Endpoint { enabled, networks }
IPNetwork { network }
network: string

Specify the IP address or IP CIDR.

IPV4Endpoint { enabled }
enabled: optional boolean

Indicate whether the IPv4 endpoint is enabled for this location.

IPV6Endpoint { enabled, networks }
enabled: optional boolean

Indicate whether the IPV6 endpoint is enabled for this location.

networks: optional array of IPV6Network { network }

Specify the list of allowed source IPv6 network ranges for this endpoint. When the list is empty, the endpoint allows all source IPs. The list takes effect only if the endpoint is enabled for this location.

network: string

Specify the IPv6 address or IPv6 CIDR.

IPV6Network { network }
network: string

Specify the IPv6 address or IPv6 CIDR.

Location { id, client_default, created_at, 11 more }
id: optional string
client_default: optional boolean

Indicate whether this location is the default location.

created_at: optional string
formatdate-time
dns_destination_ips_id: optional string

Indicate the identifier of the pair of IPv4 addresses assigned to this location.

dns_destination_ipv6_block_id: optional string

Specify the UUID of the IPv6 block brought to the gateway so that this location’s IPv6 address is allocated from the Bring Your Own IPv6 (BYOIPv6) block rather than the standard Cloudflare IPv6 block.

doh_subdomain: optional string

Specify the DNS over HTTPS domain that receives DNS requests. Gateway automatically generates this value.

ecs_support: optional boolean

Indicate whether the location must resolve EDNS queries.

endpoints: optional Endpoint { doh, dot, ipv4, ipv6 }

Configure the destination endpoints for this location.

ip: optional string

Defines the automatically generated IPv6 destination IP assigned to this location. Gateway counts all DNS requests sent to this IP as requests under this location.

ipv4_destination: optional string

Show the primary destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only.

ipv4_destination_backup: optional string

Show the backup destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only.

name: optional string

Specify the location name.

networks: optional array of { network }

Specify the list of network ranges from which requests at this location originate. The list takes effect only if it is non-empty and the IPv4 endpoint is enabled for this location.

network: string

Specify the IPv4 address or IPv4 CIDR. Limit IPv4 CIDRs to a maximum of /24.

updated_at: optional string
formatdate-time
LocationDeleteResponse = unknown

GatewayLogging

Get logging settings for the Zero Trust account
GET/accounts/{account_id}/gateway/logging
Update Zero Trust account logging settings
PUT/accounts/{account_id}/gateway/logging
ModelsExpand Collapse
LoggingSetting { redact_pii, settings_by_rule_type }
redact_pii: optional boolean

Indicate whether to redact personally identifiable information from activity logging (PII fields include source IP, user email, user ID, device ID, URL, referrer, and user agent).

settings_by_rule_type: optional { dns, http, l4 }

Configure logging settings for each rule type.

dns: optional { log_all, log_blocks }

Configure logging settings for DNS firewall.

log_all: optional boolean

Specify whether to log all requests to this service.

log_blocks: optional boolean

Specify whether to log only blocking requests to this service.

http: optional { log_all, log_blocks }

Configure logging settings for HTTP/HTTPS firewall.

log_all: optional boolean

Specify whether to log all requests to this service.

log_blocks: optional boolean

Specify whether to log only blocking requests to this service.

l4: optional { log_all, log_blocks }

Configure logging settings for Network firewall.

log_all: optional boolean

Specify whether to log all requests to this service.

log_blocks: optional boolean

Specify whether to log only blocking requests to this service.

GatewayProxy Endpoints

List proxy endpoints
GET/accounts/{account_id}/gateway/proxy_endpoints
Get a proxy endpoint
GET/accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}
Create a proxy endpoint
POST/accounts/{account_id}/gateway/proxy_endpoints
Update a proxy endpoint
PATCH/accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}
Delete a proxy endpoint
DELETE/accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}
ModelsExpand Collapse
GatewayIPs = string

Specify an IPv4 or IPv6 CIDR. Limit IPv6 to a maximum of /109 and IPv4 to a maximum of /25.

ProxyEndpoint = { ips, name, id, 4 more } or { kind, name, id, 3 more }
One of the following:
IP { ips, name, id, 4 more }
ips: array of GatewayIPs

Specify the list of CIDRs to restrict ingress connections.

name: string

Specify the name of the proxy endpoint.

id: optional string
created_at: optional string
formatdate-time
kind: optional "ip"

The proxy endpoint kind

subdomain: optional string

Specify the subdomain to use as the destination in the proxy client.

updated_at: optional string
formatdate-time
Identity { kind, name, id, 3 more }
kind: "identity"

The proxy endpoint kind

name: string

Specify the name of the proxy endpoint.

id: optional string
created_at: optional string
formatdate-time
subdomain: optional string

Specify the subdomain to use as the destination in the proxy client.

updated_at: optional string
formatdate-time
ProxyEndpointDeleteResponse = unknown

GatewayRules

List Zero Trust Gateway rules
GET/accounts/{account_id}/gateway/rules
Get Zero Trust Gateway rule details.
GET/accounts/{account_id}/gateway/rules/{rule_id}
Create a Zero Trust Gateway rule
POST/accounts/{account_id}/gateway/rules
Update a Zero Trust Gateway rule
PUT/accounts/{account_id}/gateway/rules/{rule_id}
Delete a Zero Trust Gateway rule
DELETE/accounts/{account_id}/gateway/rules/{rule_id}
List Zero Trust Gateway rules inherited from the parent account
GET/accounts/{account_id}/gateway/rules/tenant
Reset the expiration of a Zero Trust Gateway Rule
POST/accounts/{account_id}/gateway/rules/{rule_id}/reset_expiration
ModelsExpand Collapse
DNSResolverSettingsV4 { ip, port, route_through_private_network, vnet_id }
ip: string

Specify the IPv4 address of the upstream resolver.

port: optional number

Specify a port number to use for the upstream resolver. Defaults to 53 if unspecified.

route_through_private_network: optional boolean

Indicate whether to connect to this resolver over a private network. Must set when vnet_id set.

vnet_id: optional string

Specify an optional virtual network for this resolver. Uses default virtual network id if omitted.

DNSResolverSettingsV6 { ip, port, route_through_private_network, vnet_id }
ip: string

Specify the IPv6 address of the upstream resolver.

port: optional number

Specify a port number to use for the upstream resolver. Defaults to 53 if unspecified.

route_through_private_network: optional boolean

Indicate whether to connect to this resolver over a private network. Must set when vnet_id set.

vnet_id: optional string

Specify an optional virtual network for this resolver. Uses default virtual network id if omitted.

GatewayFilter = "http" or "dns" or "l4" or 2 more

Specify the protocol or layer to use.

One of the following:
"http"
"dns"
"l4"
"egress"
"dns_resolver"
GatewayRule { action, enabled, filters, 18 more }
action: "on" or "off" or "allow" or 13 more

Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to true.

One of the following:
"on"
"off"
"allow"
"block"
"scan"
"noscan"
"safesearch"
"ytrestricted"
"isolate"
"noisolate"
"override"
"l4_override"
"egress"
"resolve"
"quarantine"
"redirect"
enabled: boolean

Specify whether the rule is enabled.

filters: array of GatewayFilter

Specify the protocol or layer to evaluate the traffic, identity, and device posture expressions. Can only contain a single value.

One of the following:
"http"
"dns"
"l4"
"egress"
"dns_resolver"
name: string

Specify the rule name.

precedence: number

Set the order of your rules. Lower values indicate higher precedence. At each processing phase, evaluate applicable rules in ascending order of this value. Refer to Order of enforcement to manage precedence via Terraform.

traffic: string

Specify the wirefilter expression used for traffic matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.

id: optional string

Identify the API resource with a UUID.

maxLength36
created_at: optional string
formatdate-time
deleted_at: optional string

Indicate the date of deletion, if any.

formatdate-time
description: optional string

Specify the rule description.

device_posture: optional string

Specify the wirefilter expression used for device posture check. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.

expiration: optional { expires_at, duration, expired }

Defines the expiration time stamp and default duration of a DNS policy. Takes precedence over the policy’s schedule configuration, if any. This does not apply to HTTP or network policies. Settable only for dns rules.

expires_at: string

Show the timestamp when the policy expires and stops applying. The value must follow RFC 3339 and include a UTC offset. The system accepts non-zero offsets but converts them to the equivalent UTC+00:00 value and returns timestamps with a trailing Z. Expiration policies ignore client timezones and expire globally at the specified expires_at time.

formatdate-time
duration: optional number

Defines the default duration a policy active in minutes. Must set in order to use the reset_expiration endpoint on this rule.

minimum5
expired: optional boolean

Indicates whether the policy is expired.

identity: optional string

Specify the wirefilter expression used for identity matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.

read_only: optional boolean

Indicate that this rule is shared via the Orgs API and read only.

rule_settings: optional RuleSetting { add_headers, allow_child_bypass, audit_ssh, 23 more }

Defines settings for this rule. Settings apply only to specific rule types and must use compatible selectors. If Terraform detects drift, confirm the setting supports your rule type and check whether the API modifies the value. Use API-returned values in your configuration to prevent drift.

schedule: optional Schedule { fri, mon, sat, 5 more }

Defines the schedule for activating DNS policies. Settable only for dns and dns_resolver rules.

sharable: optional boolean

Indicate that this rule is sharable via the Orgs API.

source_account: optional string

Provide the account tag of the account that created the rule.

updated_at: optional string
formatdate-time
version: optional number

Indicate the version number of the rule(read-only).

warning_status: optional string

Indicate a warning for a misconfigured rule, if any.

RuleSetting { add_headers, allow_child_bypass, audit_ssh, 23 more }

Defines settings for this rule. Settings apply only to specific rule types and must use compatible selectors. If Terraform detects drift, confirm the setting supports your rule type and check whether the API modifies the value. Use API-returned values in your configuration to prevent drift.

add_headers: optional map[array of string]

Add custom headers to allowed requests as key-value pairs. Use header names as keys that map to arrays of header values. Settable only for http rules with the action set to allow.

allow_child_bypass: optional boolean

Set to enable MSP children to bypass this rule. Only parent MSP accounts can set this. this rule. Settable for all types of rules.

audit_ssh: optional { command_logging }

Define the settings for the Audit SSH action. Settable only for l4 rules with audit_ssh action.

command_logging: optional boolean

Enable SSH command logging.

biso_admin_controls: optional { copy, dcp, dd, 9 more }

Configure browser isolation behavior. Settable only for http rules with the action set to isolate.

copy: optional "enabled" or "disabled" or "remote_only"

Configure copy behavior. If set to remote_only, users cannot copy isolated content from the remote browser to the local clipboard. If this field is absent, copying remains enabled. Applies only when version == “v2”.

One of the following:
"enabled"
"disabled"
"remote_only"
dcp: optional boolean

Set to false to enable copy-pasting. Only applies when version == "v1".

dd: optional boolean

Set to false to enable downloading. Only applies when version == "v1".

dk: optional boolean

Set to false to enable keyboard usage. Only applies when version == "v1".

download: optional "enabled" or "disabled" or "remote_only"

Configure download behavior. When set to remote_only, users can view downloads but cannot save them. Applies only when version == “v2”.

One of the following:
"enabled"
"disabled"
"remote_only"
dp: optional boolean

Set to false to enable printing. Only applies when version == "v1".

du: optional boolean

Set to false to enable uploading. Only applies when version == "v1".

keyboard: optional "enabled" or "disabled"

Configure keyboard usage behavior. If this field is absent, keyboard usage remains enabled. Applies only when version == “v2”.

One of the following:
"enabled"
"disabled"
paste: optional "enabled" or "disabled" or "remote_only"

Configure paste behavior. If set to remote_only, users cannot paste content from the local clipboard into isolated pages. If this field is absent, pasting remains enabled. Applies only when version == “v2”.

One of the following:
"enabled"
"disabled"
"remote_only"
printing: optional "enabled" or "disabled"

Configure print behavior. Default, Printing is enabled. Applies only when version == “v2”.

One of the following:
"enabled"
"disabled"
upload: optional "enabled" or "disabled"

Configure upload behavior. If this field is absent, uploading remains enabled. Applies only when version == “v2”.

One of the following:
"enabled"
"disabled"
version: optional "v1" or "v2"

Indicate which version of the browser isolation controls should apply.

One of the following:
"v1"
"v2"
block_page: optional { target_uri, include_context }

Configure custom block page settings. If missing or null, use the account settings. Settable only for http rules with the action set to block.

target_uri: string

Specify the URI to which the user is redirected.

formaturi
include_context: optional boolean

Specify whether to pass the context information as query parameters.

block_page_enabled: optional boolean

Enable the custom block page. Settable only for dns rules with action block.

block_reason: optional string

Explain why the rule blocks the request. The custom block page shows this text (if enabled). Settable only for dns, l4, and http rules when the action set to block.

bypass_parent_rule: optional boolean

Set to enable MSP accounts to bypass their parent’s rules. Only MSP child accounts can set this. Settable for all types of rules.

check_session: optional { duration, enforce }

Configure session check behavior. Settable only for l4 and http rules with the action set to allow.

duration: optional string

Sets the required session freshness threshold. The API returns a normalized version of this value.

enforce: optional boolean

Enable session enforcement.

dns_resolvers: optional { ipv4, ipv6 }

Configure custom resolvers to route queries that match the resolver policy. Unused with ‘resolve_dns_through_cloudflare’ or ‘resolve_dns_internally’ settings. DNS queries get routed to the address closest to their origin. Only valid when a rule’s action set to ‘resolve’. Settable only for dns_resolver rules.

ipv4: optional array of DNSResolverSettingsV4 { ip, port, route_through_private_network, vnet_id }
ip: string

Specify the IPv4 address of the upstream resolver.

port: optional number

Specify a port number to use for the upstream resolver. Defaults to 53 if unspecified.

route_through_private_network: optional boolean

Indicate whether to connect to this resolver over a private network. Must set when vnet_id set.

vnet_id: optional string

Specify an optional virtual network for this resolver. Uses default virtual network id if omitted.

ipv6: optional array of DNSResolverSettingsV6 { ip, port, route_through_private_network, vnet_id }
ip: string

Specify the IPv6 address of the upstream resolver.

port: optional number

Specify a port number to use for the upstream resolver. Defaults to 53 if unspecified.

route_through_private_network: optional boolean

Indicate whether to connect to this resolver over a private network. Must set when vnet_id set.

vnet_id: optional string

Specify an optional virtual network for this resolver. Uses default virtual network id if omitted.

egress: optional { ipv4, ipv4_fallback, ipv6 }

Configure how Gateway Proxy traffic egresses. You can enable this setting for rules with Egress actions and filters, or omit it to indicate local egress via WARP IPs. Settable only for egress rules.

ipv4: optional string

Specify the IPv4 address to use for egress.

ipv4_fallback: optional string

Specify the fallback IPv4 address to use for egress when the primary IPv4 fails. Set ‘0.0.0.0’ to indicate local egress via WARP IPs.

ipv6: optional string

Specify the IPv6 range to use for egress.

forensic_copy: optional { enabled }

Configure whether a copy of the HTTP request will be sent to storage when the rule matches.

enabled: optional boolean

Enable sending the copy to storage.

ignore_cname_category_matches: optional boolean

Ignore category matches at CNAME domains in a response. When off, evaluate categories in this rule against all CNAME domain categories in the response. Settable only for dns and dns_resolver rules.

insecure_disable_dnssec_validation: optional boolean

Specify whether to disable DNSSEC validation (for Allow actions) [INSECURE]. Settable only for dns rules.

ip_categories: optional boolean

Enable IPs in DNS resolver category blocks. The system blocks only domain name categories unless you enable this setting. Settable only for dns and dns_resolver rules.

ip_indicator_feeds: optional boolean

Indicates whether to include IPs in DNS resolver indicator feed blocks. Default, indicator feeds block only domain names. Settable only for dns and dns_resolver rules.

l4override: optional { ip, port }

Send matching traffic to the supplied destination IP address and port. Settable only for l4 rules with the action set to l4_override.

ip: optional string

Defines the IPv4 or IPv6 address.

port: optional number

Defines a port number to use for TCP/UDP overrides.

notification_settings: optional { enabled, include_context, msg, support_url }

Configure a notification to display on the user’s device when this rule matched. Settable for all types of rules with the action set to block.

enabled: optional boolean

Enable notification.

include_context: optional boolean

Indicates whether to pass the context information as query parameters.

msg: optional string

Customize the message shown in the notification.

support_url: optional string

Defines an optional URL to direct users to additional information. If unset, the notification opens a block page.

override_host: optional string

Defines a hostname for override, for the matching DNS queries. Settable only for dns rules with the action set to override.

override_ips: optional array of string

Defines a an IP or set of IPs for overriding matched DNS queries. Settable only for dns rules with the action set to override.

payload_log: optional { enabled }

Configure DLP payload logging. Settable only for http rules.

enabled: optional boolean

Enable DLP payload logging for this rule.

quarantine: optional { file_types }

Configure settings that apply to quarantine rules. Settable only for http rules.

file_types: optional array of "exe" or "pdf" or "doc" or 10 more

Specify the types of files to sandbox.

One of the following:
"exe"
"pdf"
"doc"
"docm"
"docx"
"rtf"
"ppt"
"pptx"
"xls"
"xlsm"
"xlsx"
"zip"
"rar"
redirect: optional { target_uri, include_context, preserve_path_and_query }

Apply settings to redirect rules. Settable only for http rules with the action set to redirect.

target_uri: string

Specify the URI to which the user is redirected.

formaturi
include_context: optional boolean

Specify whether to pass the context information as query parameters.

preserve_path_and_query: optional boolean

Specify whether to append the path and query parameters from the original request to target_uri.

resolve_dns_internally: optional { fallback, view_id }

Configure to forward the query to the internal DNS service, passing the specified ‘view_id’ as input. Not used when ‘dns_resolvers’ is specified or ‘resolve_dns_through_cloudflare’ is set. Only valid when a rule’s action set to ‘resolve’. Settable only for dns_resolver rules.

fallback: optional "none" or "public_dns"

Specify the fallback behavior to apply when the internal DNS response code differs from ‘NOERROR’ or when the response data contains only CNAME records for ‘A’ or ‘AAAA’ queries.

One of the following:
"none"
"public_dns"
view_id: optional string

Specify the internal DNS view identifier to pass to the internal DNS service.

resolve_dns_through_cloudflare: optional boolean

Enable to send queries that match the policy to Cloudflare’s default 1.1.1.1 DNS resolver. Cannot set when ‘dns_resolvers’ specified or ‘resolve_dns_internally’ is set. Only valid when a rule’s action set to ‘resolve’. Settable only for dns_resolver rules.

untrusted_cert: optional { action }

Configure behavior when an upstream certificate is invalid or an SSL error occurs. Settable only for http rules with the action set to allow.

action: optional "pass_through" or "block" or "error"

Defines the action performed when an untrusted certificate seen. The default action an error with HTTP code 526.

One of the following:
"pass_through"
"block"
"error"
Schedule { fri, mon, sat, 5 more }

Defines the schedule for activating DNS policies. Settable only for dns and dns_resolver rules.

fri: optional string

Specify the time intervals when the rule is active on Fridays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Fridays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

mon: optional string

Specify the time intervals when the rule is active on Mondays, in the increasing order from 00:00-24:00(capped at maximum of 6 time splits). If this parameter omitted, the rule is deactivated on Mondays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

sat: optional string

Specify the time intervals when the rule is active on Saturdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Saturdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

sun: optional string

Specify the time intervals when the rule is active on Sundays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Sundays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

thu: optional string

Specify the time intervals when the rule is active on Thursdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Thursdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

time_zone: optional string

Specify the time zone for rule evaluation. When a valid time zone city name is provided, Gateway always uses the current time for that time zone. When this parameter is omitted, Gateway uses the time zone determined from the user’s IP address. Colo time zone is used when the user’s IP address does not resolve to a location.

tue: optional string

Specify the time intervals when the rule is active on Tuesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Tuesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

wed: optional string

Specify the time intervals when the rule is active on Wednesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Wednesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

RuleDeleteResponse = unknown

GatewayCertificates

List Zero Trust certificates
GET/accounts/{account_id}/gateway/certificates
Get Zero Trust certificate details
GET/accounts/{account_id}/gateway/certificates/{certificate_id}
Create Zero Trust certificate
POST/accounts/{account_id}/gateway/certificates
Delete Zero Trust certificate
DELETE/accounts/{account_id}/gateway/certificates/{certificate_id}
Activate a Zero Trust certificate
POST/accounts/{account_id}/gateway/certificates/{certificate_id}/activate
Deactivate a Zero Trust certificate
POST/accounts/{account_id}/gateway/certificates/{certificate_id}/deactivate
ModelsExpand Collapse
CertificateListResponse { id, binding_status, certificate, 9 more }
id: optional string

Identify the certificate with a UUID.

maxLength36
binding_status: optional "pending_deployment" or "available" or "pending_deletion" or "inactive"

Indicate the read-only deployment status of the certificate on Cloudflare’s edge. Gateway TLS interception can use certificates in the ‘available’ (previously called ‘active’) state.

One of the following:
"pending_deployment"
"available"
"pending_deletion"
"inactive"
certificate: optional string

Provide the CA certificate (read-only).

created_at: optional string
formatdate-time
expires_on: optional string
formatdate-time
fingerprint: optional string

Provide the SHA256 fingerprint of the certificate (read-only).

in_use: optional boolean

Indicate whether Gateway TLS interception uses this certificate (read-only). You cannot set this value directly. To configure interception, use the Gateway configuration setting named certificate (read-only).

issuer_org: optional string

Indicate the organization that issued the certificate (read-only).

issuer_raw: optional string

Provide the entire issuer field of the certificate (read-only).

type: optional "custom" or "gateway_managed"

Indicate the read-only certificate type, BYO-PKI (custom) or Gateway-managed.

One of the following:
"custom"
"gateway_managed"
updated_at: optional string
formatdate-time
uploaded_on: optional string
formatdate-time
CertificateGetResponse { id, binding_status, certificate, 9 more }
id: optional string

Identify the certificate with a UUID.

maxLength36
binding_status: optional "pending_deployment" or "available" or "pending_deletion" or "inactive"

Indicate the read-only deployment status of the certificate on Cloudflare’s edge. Gateway TLS interception can use certificates in the ‘available’ (previously called ‘active’) state.

One of the following:
"pending_deployment"
"available"
"pending_deletion"
"inactive"
certificate: optional string

Provide the CA certificate (read-only).

created_at: optional string
formatdate-time
expires_on: optional string
formatdate-time
fingerprint: optional string

Provide the SHA256 fingerprint of the certificate (read-only).

in_use: optional boolean

Indicate whether Gateway TLS interception uses this certificate (read-only). You cannot set this value directly. To configure interception, use the Gateway configuration setting named certificate (read-only).

issuer_org: optional string

Indicate the organization that issued the certificate (read-only).

issuer_raw: optional string

Provide the entire issuer field of the certificate (read-only).

type: optional "custom" or "gateway_managed"

Indicate the read-only certificate type, BYO-PKI (custom) or Gateway-managed.

One of the following:
"custom"
"gateway_managed"
updated_at: optional string
formatdate-time
uploaded_on: optional string
formatdate-time
CertificateCreateResponse { id, binding_status, certificate, 9 more }
id: optional string

Identify the certificate with a UUID.

maxLength36
binding_status: optional "pending_deployment" or "available" or "pending_deletion" or "inactive"

Indicate the read-only deployment status of the certificate on Cloudflare’s edge. Gateway TLS interception can use certificates in the ‘available’ (previously called ‘active’) state.

One of the following:
"pending_deployment"
"available"
"pending_deletion"
"inactive"
certificate: optional string

Provide the CA certificate (read-only).

created_at: optional string
formatdate-time
expires_on: optional string
formatdate-time
fingerprint: optional string

Provide the SHA256 fingerprint of the certificate (read-only).

in_use: optional boolean

Indicate whether Gateway TLS interception uses this certificate (read-only). You cannot set this value directly. To configure interception, use the Gateway configuration setting named certificate (read-only).

issuer_org: optional string

Indicate the organization that issued the certificate (read-only).

issuer_raw: optional string

Provide the entire issuer field of the certificate (read-only).

type: optional "custom" or "gateway_managed"

Indicate the read-only certificate type, BYO-PKI (custom) or Gateway-managed.

One of the following:
"custom"
"gateway_managed"
updated_at: optional string
formatdate-time
uploaded_on: optional string
formatdate-time
CertificateDeleteResponse { id, binding_status, certificate, 9 more }
id: optional string

Identify the certificate with a UUID.

maxLength36
binding_status: optional "pending_deployment" or "available" or "pending_deletion" or "inactive"

Indicate the read-only deployment status of the certificate on Cloudflare’s edge. Gateway TLS interception can use certificates in the ‘available’ (previously called ‘active’) state.

One of the following:
"pending_deployment"
"available"
"pending_deletion"
"inactive"
certificate: optional string

Provide the CA certificate (read-only).

created_at: optional string
formatdate-time
expires_on: optional string
formatdate-time
fingerprint: optional string

Provide the SHA256 fingerprint of the certificate (read-only).

in_use: optional boolean

Indicate whether Gateway TLS interception uses this certificate (read-only). You cannot set this value directly. To configure interception, use the Gateway configuration setting named certificate (read-only).

issuer_org: optional string

Indicate the organization that issued the certificate (read-only).

issuer_raw: optional string

Provide the entire issuer field of the certificate (read-only).

type: optional "custom" or "gateway_managed"

Indicate the read-only certificate type, BYO-PKI (custom) or Gateway-managed.

One of the following:
"custom"
"gateway_managed"
updated_at: optional string
formatdate-time
uploaded_on: optional string
formatdate-time
CertificateActivateResponse { id, binding_status, certificate, 9 more }
id: optional string

Identify the certificate with a UUID.

maxLength36
binding_status: optional "pending_deployment" or "available" or "pending_deletion" or "inactive"

Indicate the read-only deployment status of the certificate on Cloudflare’s edge. Gateway TLS interception can use certificates in the ‘available’ (previously called ‘active’) state.

One of the following:
"pending_deployment"
"available"
"pending_deletion"
"inactive"
certificate: optional string

Provide the CA certificate (read-only).

created_at: optional string
formatdate-time
expires_on: optional string
formatdate-time
fingerprint: optional string

Provide the SHA256 fingerprint of the certificate (read-only).

in_use: optional boolean

Indicate whether Gateway TLS interception uses this certificate (read-only). You cannot set this value directly. To configure interception, use the Gateway configuration setting named certificate (read-only).

issuer_org: optional string

Indicate the organization that issued the certificate (read-only).

issuer_raw: optional string

Provide the entire issuer field of the certificate (read-only).

type: optional "custom" or "gateway_managed"

Indicate the read-only certificate type, BYO-PKI (custom) or Gateway-managed.

One of the following:
"custom"
"gateway_managed"
updated_at: optional string
formatdate-time
uploaded_on: optional string
formatdate-time
CertificateDeactivateResponse { id, binding_status, certificate, 9 more }
id: optional string

Identify the certificate with a UUID.

maxLength36
binding_status: optional "pending_deployment" or "available" or "pending_deletion" or "inactive"

Indicate the read-only deployment status of the certificate on Cloudflare’s edge. Gateway TLS interception can use certificates in the ‘available’ (previously called ‘active’) state.

One of the following:
"pending_deployment"
"available"
"pending_deletion"
"inactive"
certificate: optional string

Provide the CA certificate (read-only).

created_at: optional string
formatdate-time
expires_on: optional string
formatdate-time
fingerprint: optional string

Provide the SHA256 fingerprint of the certificate (read-only).

in_use: optional boolean

Indicate whether Gateway TLS interception uses this certificate (read-only). You cannot set this value directly. To configure interception, use the Gateway configuration setting named certificate (read-only).

issuer_org: optional string

Indicate the organization that issued the certificate (read-only).

issuer_raw: optional string

Provide the entire issuer field of the certificate (read-only).

type: optional "custom" or "gateway_managed"

Indicate the read-only certificate type, BYO-PKI (custom) or Gateway-managed.

One of the following:
"custom"
"gateway_managed"
updated_at: optional string
formatdate-time
uploaded_on: optional string
formatdate-time

GatewayPacfiles

List PAC files
GET/accounts/{account_id}/gateway/pacfiles
Get a PAC file
GET/accounts/{account_id}/gateway/pacfiles/{pacfile_id}
Create a PAC file
POST/accounts/{account_id}/gateway/pacfiles
Update a Zero Trust Gateway PAC file
PUT/accounts/{account_id}/gateway/pacfiles/{pacfile_id}
Delete a PAC file
DELETE/accounts/{account_id}/gateway/pacfiles/{pacfile_id}
ModelsExpand Collapse
PacfileListResponse { id, created_at, description, 4 more }
id: optional string
created_at: optional string
formatdate-time
description: optional string

Detailed description of the PAC file.

name: optional string

Name of the PAC file.

slug: optional string

URL-friendly version of the PAC file name.

updated_at: optional string
formatdate-time
url: optional string

Unique URL to download the PAC file.

PacfileGetResponse { id, contents, created_at, 5 more }
id: optional string
contents: optional string

Actual contents of the PAC file

created_at: optional string
formatdate-time
description: optional string

Detailed description of the PAC file.

name: optional string

Name of the PAC file.

slug: optional string

URL-friendly version of the PAC file name.

updated_at: optional string
formatdate-time
url: optional string

Unique URL to download the PAC file.

PacfileCreateResponse { id, contents, created_at, 5 more }
id: optional string
contents: optional string

Actual contents of the PAC file

created_at: optional string
formatdate-time
description: optional string

Detailed description of the PAC file.

name: optional string

Name of the PAC file.

slug: optional string

URL-friendly version of the PAC file name.

updated_at: optional string
formatdate-time
url: optional string

Unique URL to download the PAC file.

PacfileUpdateResponse { id, contents, created_at, 5 more }
id: optional string
contents: optional string

Actual contents of the PAC file

created_at: optional string
formatdate-time
description: optional string

Detailed description of the PAC file.

name: optional string

Name of the PAC file.

slug: optional string

URL-friendly version of the PAC file name.

updated_at: optional string
formatdate-time
url: optional string

Unique URL to download the PAC file.

PacfileDeleteResponse = unknown