Skip to content
Start here

Update Zero Trust account configuration

client.zeroTrust.gateway.configurations.update(ConfigurationUpdateParams { account_id, settings } params, RequestOptionsoptions?): ConfigurationUpdateResponse { created_at, settings, updated_at }
PUT/accounts/{account_id}/gateway/configuration

Update the current Zero Trust account configuration.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

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

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

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

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
params: ConfigurationUpdateParams { account_id, settings }
account_id: string

Path param

settings?: GatewayConfigurationSettings { activity_log, antivirus, block_page, 11 more }

Body param: Specify account settings.

activity_log?: ActivityLogSettings { enabled } | null

Specify activity log settings.

enabled?: boolean | null

Specify whether to log activity.

antivirus?: AntiVirusSettings { enabled_download_phase, enabled_upload_phase, fail_closed, notification_settings } | null

Specify anti-virus settings.

enabled_download_phase?: boolean | null

Specify whether to enable anti-virus scanning on downloads.

enabled_upload_phase?: boolean | null

Specify whether to enable anti-virus scanning on uploads.

fail_closed?: boolean | null

Specify whether to block requests for unscannable files.

notification_settings?: NotificationSettings { enabled, include_context, msg, support_url } | null

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

enabled?: boolean

Specify whether to enable notifications.

include_context?: boolean

Specify whether to include context information as query parameters.

msg?: string

Specify the message to show in the notification.

support_url?: string

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

block_page?: BlockPageSettings { background_color, enabled, footer_text, 12 more } | null

Specify block page layout settings.

background_color?: string

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

enabled?: boolean | null

Specify whether to enable the custom block page.

header_text?: string

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

include_context?: boolean

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

logo_path?: string

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

mailto_address?: string

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

mailto_subject?: string

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

mode?: "" | "customized_block_page" | "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?: string

Specify the block page title when the mode is customized_block_page.

read_only?: boolean | null

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

source_account?: string | null

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

target_uri?: string

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

formaturi
version?: number | null

Indicate the version number of the setting.

body_scanning?: BodyScanningSettings { inspection_mode } | null

Specify the DLP inspection mode.

inspection_mode?: "deep" | "shallow"

Specify the inspection mode as either deep or shallow.

One of the following:
"deep"
"shallow"
browser_isolation?: BrowserIsolationSettings { non_identity_enabled, url_browser_isolation_enabled } | null

Specify Clientless Browser Isolation settings.

non_identity_enabled?: boolean

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

url_browser_isolation_enabled?: boolean

Specify whether to enable Clientless Browser Isolation.

certificate?: Certificate | null

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?: CustomCertificateSettings { enabled, id, binding_status, updated_at } | null

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

enabled: boolean | null

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

id?: string

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

binding_status?: string

Indicate the internal certificate status.

updated_at?: string
formatdate-time
extended_email_matching?: ExtendedEmailMatching { enabled, read_only, source_account, version } | null

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?: boolean | null

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

read_only?: boolean

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

source_account?: string

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

version?: number

Indicate the version number of the setting.

fips?: FipsSettings { tls } | null

Specify FIPS settings.

tls?: boolean

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

host_selector?: HostSelector | null

Enable host selection in egress policies.

enabled?: boolean | null

Specify whether to enable filtering via hosts for egress policies.

inspection?: Inspection | null

Define the proxy inspection mode.

mode?: "static" | "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?: ProtocolDetection { enabled } | null

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

enabled?: boolean | null

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

sandbox?: Sandbox | null

Specify whether to enable the sandbox.

enabled?: boolean | null

Specify whether to enable the sandbox.

fallback_action?: "allow" | "block"

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

One of the following:
"allow"
"block"
tls_decrypt?: TLSSettings { enabled } | null

Specify whether to inspect encrypted HTTP traffic.

enabled?: boolean

Specify whether to inspect encrypted HTTP traffic.

ReturnsExpand Collapse
ConfigurationUpdateResponse { created_at, settings, updated_at }

Specify account settings.

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

Specify account settings.

activity_log?: ActivityLogSettings { enabled } | null

Specify activity log settings.

enabled?: boolean | null

Specify whether to log activity.

antivirus?: AntiVirusSettings { enabled_download_phase, enabled_upload_phase, fail_closed, notification_settings } | null

Specify anti-virus settings.

enabled_download_phase?: boolean | null

Specify whether to enable anti-virus scanning on downloads.

enabled_upload_phase?: boolean | null

Specify whether to enable anti-virus scanning on uploads.

fail_closed?: boolean | null

Specify whether to block requests for unscannable files.

notification_settings?: NotificationSettings { enabled, include_context, msg, support_url } | null

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

enabled?: boolean

Specify whether to enable notifications.

include_context?: boolean

Specify whether to include context information as query parameters.

msg?: string

Specify the message to show in the notification.

support_url?: string

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

block_page?: BlockPageSettings { background_color, enabled, footer_text, 12 more } | null

Specify block page layout settings.

background_color?: string

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

enabled?: boolean | null

Specify whether to enable the custom block page.

header_text?: string

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

include_context?: boolean

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

logo_path?: string

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

mailto_address?: string

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

mailto_subject?: string

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

mode?: "" | "customized_block_page" | "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?: string

Specify the block page title when the mode is customized_block_page.

read_only?: boolean | null

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

source_account?: string | null

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

target_uri?: string

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

formaturi
version?: number | null

Indicate the version number of the setting.

body_scanning?: BodyScanningSettings { inspection_mode } | null

Specify the DLP inspection mode.

inspection_mode?: "deep" | "shallow"

Specify the inspection mode as either deep or shallow.

One of the following:
"deep"
"shallow"
browser_isolation?: BrowserIsolationSettings { non_identity_enabled, url_browser_isolation_enabled } | null

Specify Clientless Browser Isolation settings.

non_identity_enabled?: boolean

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

url_browser_isolation_enabled?: boolean

Specify whether to enable Clientless Browser Isolation.

certificate?: Certificate | null

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?: CustomCertificateSettings { enabled, id, binding_status, updated_at } | null

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

enabled: boolean | null

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

id?: string

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

binding_status?: string

Indicate the internal certificate status.

updated_at?: string
formatdate-time
extended_email_matching?: ExtendedEmailMatching { enabled, read_only, source_account, version } | null

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?: boolean | null

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

read_only?: boolean

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

source_account?: string

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

version?: number

Indicate the version number of the setting.

fips?: FipsSettings { tls } | null

Specify FIPS settings.

tls?: boolean

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

host_selector?: HostSelector | null

Enable host selection in egress policies.

enabled?: boolean | null

Specify whether to enable filtering via hosts for egress policies.

inspection?: Inspection | null

Define the proxy inspection mode.

mode?: "static" | "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?: ProtocolDetection { enabled } | null

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

enabled?: boolean | null

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

sandbox?: Sandbox | null

Specify whether to enable the sandbox.

enabled?: boolean | null

Specify whether to enable the sandbox.

fallback_action?: "allow" | "block"

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

One of the following:
"allow"
"block"
tls_decrypt?: TLSSettings { enabled } | null

Specify whether to inspect encrypted HTTP traffic.

enabled?: boolean

Specify whether to inspect encrypted HTTP traffic.

updated_at?: string
formatdate-time

Update Zero Trust account configuration

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const configuration = await client.zeroTrust.gateway.configurations.update({
  account_id: '699d98642c564d2e855e9661899b7252',
});

console.log(configuration.created_at);
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "created_at": "2014-01-01T05:20:00.12345Z",
    "settings": {
      "activity_log": {
        "enabled": true
      },
      "antivirus": {
        "enabled_download_phase": false,
        "enabled_upload_phase": false,
        "fail_closed": false,
        "notification_settings": {
          "enabled": true,
          "include_context": true,
          "msg": "msg",
          "support_url": "support_url"
        }
      },
      "block_page": {
        "background_color": "background_color",
        "enabled": true,
        "footer_text": "--footer--",
        "header_text": "--header--",
        "include_context": true,
        "logo_path": "https://logos.com/a.png",
        "mailto_address": "admin@example.com",
        "mailto_subject": "Blocked User Inquiry",
        "mode": "",
        "name": "Cloudflare",
        "read_only": true,
        "source_account": "source_account",
        "suppress_footer": false,
        "target_uri": "https://example.com",
        "version": 1
      },
      "body_scanning": {
        "inspection_mode": "deep"
      },
      "browser_isolation": {
        "non_identity_enabled": true,
        "url_browser_isolation_enabled": true
      },
      "certificate": {
        "id": "d1b364c5-1311-466e-a194-f0e943e0799f"
      },
      "custom_certificate": {
        "enabled": true,
        "id": "d1b364c5-1311-466e-a194-f0e943e0799f",
        "binding_status": "pending_deployment",
        "updated_at": "2019-12-27T18:11:19.117Z"
      },
      "extended_email_matching": {
        "enabled": true,
        "read_only": true,
        "source_account": "source_account",
        "version": 1
      },
      "fips": {
        "tls": true
      },
      "host_selector": {
        "enabled": false
      },
      "inspection": {
        "mode": "static"
      },
      "protocol_detection": {
        "enabled": true
      },
      "sandbox": {
        "enabled": true,
        "fallback_action": "allow"
      },
      "tls_decrypt": {
        "enabled": true
      }
    },
    "updated_at": "2014-01-01T05:20:00.12345Z"
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "created_at": "2014-01-01T05:20:00.12345Z",
    "settings": {
      "activity_log": {
        "enabled": true
      },
      "antivirus": {
        "enabled_download_phase": false,
        "enabled_upload_phase": false,
        "fail_closed": false,
        "notification_settings": {
          "enabled": true,
          "include_context": true,
          "msg": "msg",
          "support_url": "support_url"
        }
      },
      "block_page": {
        "background_color": "background_color",
        "enabled": true,
        "footer_text": "--footer--",
        "header_text": "--header--",
        "include_context": true,
        "logo_path": "https://logos.com/a.png",
        "mailto_address": "admin@example.com",
        "mailto_subject": "Blocked User Inquiry",
        "mode": "",
        "name": "Cloudflare",
        "read_only": true,
        "source_account": "source_account",
        "suppress_footer": false,
        "target_uri": "https://example.com",
        "version": 1
      },
      "body_scanning": {
        "inspection_mode": "deep"
      },
      "browser_isolation": {
        "non_identity_enabled": true,
        "url_browser_isolation_enabled": true
      },
      "certificate": {
        "id": "d1b364c5-1311-466e-a194-f0e943e0799f"
      },
      "custom_certificate": {
        "enabled": true,
        "id": "d1b364c5-1311-466e-a194-f0e943e0799f",
        "binding_status": "pending_deployment",
        "updated_at": "2019-12-27T18:11:19.117Z"
      },
      "extended_email_matching": {
        "enabled": true,
        "read_only": true,
        "source_account": "source_account",
        "version": 1
      },
      "fips": {
        "tls": true
      },
      "host_selector": {
        "enabled": false
      },
      "inspection": {
        "mode": "static"
      },
      "protocol_detection": {
        "enabled": true
      },
      "sandbox": {
        "enabled": true,
        "fallback_action": "allow"
      },
      "tls_decrypt": {
        "enabled": true
      }
    },
    "updated_at": "2014-01-01T05:20:00.12345Z"
  }
}