# Locations ## List Zero Trust Gateway locations `client.zeroTrust.gateway.locations.list(LocationListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/gateway/locations` List Zero Trust Gateway locations for an account. ### Parameters - `params: LocationListParams` - `account_id: string` ### Returns - `Location` - `id?: string` - `client_default?: boolean` Indicate whether this location is the default location. - `created_at?: string` - `dns_destination_ips_id?: string` Indicate the identifier of the pair of IPv4 addresses assigned to this location. - `dns_destination_ipv6_block_id?: string | null` 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?: string` Specify the DNS over HTTPS domain that receives DNS requests. Gateway automatically generates this value. - `ecs_support?: boolean` Indicate whether the location must resolve EDNS queries. - `endpoints?: Endpoint | null` Configure the destination endpoints for this location. - `doh: DOHEndpoint` - `enabled?: boolean` Indicate whether the DOH endpoint is enabled for this location. - `networks?: Array | null` 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?: boolean` Specify whether the DOH endpoint requires user identity authentication. - `dot: DOTEndpoint` - `enabled?: boolean` Indicate whether the DOT endpoint is enabled for this location. - `networks?: Array | null` 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. - `ipv4: IPV4Endpoint` - `enabled?: boolean` Indicate whether the IPv4 endpoint is enabled for this location. - `ipv6: IPV6Endpoint` - `enabled?: boolean` Indicate whether the IPV6 endpoint is enabled for this location. - `networks?: Array | null` 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. - `ip?: 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?: string` Show the primary destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. - `ipv4_destination_backup?: string` Show the backup destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. - `max_ttl?: MaxTTL | null` Controls how DNS response TTLs are capped for this location relative to the account `max_ttl_secs` setting. Omitting `max_ttl` on update resets it to `inherit`. - `mode: "inherit" | "override" | "disabled"` `inherit` uses the account `max_ttl_secs`. `override` uses this location's `ttl_secs`. `disabled` leaves returned TTLs unchanged. - `"inherit"` - `"override"` - `"disabled"` - `ttl_secs?: number | null` Location-specific cap on DNS response TTLs, in seconds. Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or `disabled`. - `name?: string` Specify the location name. - `networks?: Array | null` 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?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const location of client.zeroTrust.gateway.locations.list({ account_id: '699d98642c564d2e855e9661899b7252', })) { console.log(location.id); } ``` #### Response ```json { "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": [ { "id": "ed35569b41ce4d1facfe683550f54086", "client_default": false, "created_at": "2014-01-01T05:20:00.12345Z", "dns_destination_ips_id": "0e4a32c6-6fb8-4858-9296-98f51631e8e6", "dns_destination_ipv6_block_id": "b08f7231-d458-495c-98ef-190604c9ee83", "doh_subdomain": "oli3n9zkz5", "ecs_support": false, "endpoints": { "doh": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ], "require_token": true }, "dot": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ] }, "ipv4": { "enabled": true }, "ipv6": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ] } }, "ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "ipv4_destination": "172.64.36.1", "ipv4_destination_backup": "172.64.36.2", "max_ttl": { "mode": "override", "ttl_secs": 3600 }, "name": "Austin Office Location", "networks": [ { "network": "192.0.2.1/32" } ], "updated_at": "2014-01-01T05:20:00.12345Z" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get Zero Trust Gateway location details `client.zeroTrust.gateway.locations.get(stringlocationID, LocationGetParamsparams, RequestOptionsoptions?): Location` **get** `/accounts/{account_id}/gateway/locations/{location_id}` Get a single Zero Trust Gateway location. ### Parameters - `locationID: string` - `params: LocationGetParams` - `account_id: string` ### Returns - `Location` - `id?: string` - `client_default?: boolean` Indicate whether this location is the default location. - `created_at?: string` - `dns_destination_ips_id?: string` Indicate the identifier of the pair of IPv4 addresses assigned to this location. - `dns_destination_ipv6_block_id?: string | null` 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?: string` Specify the DNS over HTTPS domain that receives DNS requests. Gateway automatically generates this value. - `ecs_support?: boolean` Indicate whether the location must resolve EDNS queries. - `endpoints?: Endpoint | null` Configure the destination endpoints for this location. - `doh: DOHEndpoint` - `enabled?: boolean` Indicate whether the DOH endpoint is enabled for this location. - `networks?: Array | null` 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?: boolean` Specify whether the DOH endpoint requires user identity authentication. - `dot: DOTEndpoint` - `enabled?: boolean` Indicate whether the DOT endpoint is enabled for this location. - `networks?: Array | null` 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. - `ipv4: IPV4Endpoint` - `enabled?: boolean` Indicate whether the IPv4 endpoint is enabled for this location. - `ipv6: IPV6Endpoint` - `enabled?: boolean` Indicate whether the IPV6 endpoint is enabled for this location. - `networks?: Array | null` 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. - `ip?: 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?: string` Show the primary destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. - `ipv4_destination_backup?: string` Show the backup destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. - `max_ttl?: MaxTTL | null` Controls how DNS response TTLs are capped for this location relative to the account `max_ttl_secs` setting. Omitting `max_ttl` on update resets it to `inherit`. - `mode: "inherit" | "override" | "disabled"` `inherit` uses the account `max_ttl_secs`. `override` uses this location's `ttl_secs`. `disabled` leaves returned TTLs unchanged. - `"inherit"` - `"override"` - `"disabled"` - `ttl_secs?: number | null` Location-specific cap on DNS response TTLs, in seconds. Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or `disabled`. - `name?: string` Specify the location name. - `networks?: Array | null` 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?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const location = await client.zeroTrust.gateway.locations.get('ed35569b41ce4d1facfe683550f54086', { account_id: '699d98642c564d2e855e9661899b7252', }); console.log(location.id); ``` #### Response ```json { "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": { "id": "ed35569b41ce4d1facfe683550f54086", "client_default": false, "created_at": "2014-01-01T05:20:00.12345Z", "dns_destination_ips_id": "0e4a32c6-6fb8-4858-9296-98f51631e8e6", "dns_destination_ipv6_block_id": "b08f7231-d458-495c-98ef-190604c9ee83", "doh_subdomain": "oli3n9zkz5", "ecs_support": false, "endpoints": { "doh": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ], "require_token": true }, "dot": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ] }, "ipv4": { "enabled": true }, "ipv6": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ] } }, "ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "ipv4_destination": "172.64.36.1", "ipv4_destination_backup": "172.64.36.2", "max_ttl": { "mode": "override", "ttl_secs": 3600 }, "name": "Austin Office Location", "networks": [ { "network": "192.0.2.1/32" } ], "updated_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Create a Zero Trust Gateway location `client.zeroTrust.gateway.locations.create(LocationCreateParamsparams, RequestOptionsoptions?): Location` **post** `/accounts/{account_id}/gateway/locations` Create a new Zero Trust Gateway location. ### Parameters - `params: LocationCreateParams` - `account_id: string` Path param - `name: string` Body param: Specify the location name. - `client_default?: boolean` Body param: Indicate whether this location is the default location. - `dns_destination_ips_id?: string` Body param: Specify the identifier of the pair of IPv4 addresses assigned to this location. When creating a location, if this field is absent or set to null, the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned. When updating a location, if this field is absent or set to null, the pre-assigned pair remains unchanged. - `ecs_support?: boolean` Body param: Indicate whether the location must resolve EDNS queries. - `endpoints?: Endpoint | null` Body param: Configure the destination endpoints for this location. - `doh: DOHEndpoint` - `enabled?: boolean` Indicate whether the DOH endpoint is enabled for this location. - `networks?: Array | null` 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?: boolean` Specify whether the DOH endpoint requires user identity authentication. - `dot: DOTEndpoint` - `enabled?: boolean` Indicate whether the DOT endpoint is enabled for this location. - `networks?: Array | null` 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. - `ipv4: IPV4Endpoint` - `enabled?: boolean` Indicate whether the IPv4 endpoint is enabled for this location. - `ipv6: IPV6Endpoint` - `enabled?: boolean` Indicate whether the IPV6 endpoint is enabled for this location. - `networks?: Array | null` 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. - `max_ttl?: MaxTTL | null` Body param: Controls how DNS response TTLs are capped for this location relative to the account `max_ttl_secs` setting. Omitting `max_ttl` on update resets it to `inherit`. - `mode: "inherit" | "override" | "disabled"` `inherit` uses the account `max_ttl_secs`. `override` uses this location's `ttl_secs`. `disabled` leaves returned TTLs unchanged. - `"inherit"` - `"override"` - `"disabled"` - `ttl_secs?: number | null` Location-specific cap on DNS response TTLs, in seconds. Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or `disabled`. - `networks?: Array | null` Body param: 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. ### Returns - `Location` - `id?: string` - `client_default?: boolean` Indicate whether this location is the default location. - `created_at?: string` - `dns_destination_ips_id?: string` Indicate the identifier of the pair of IPv4 addresses assigned to this location. - `dns_destination_ipv6_block_id?: string | null` 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?: string` Specify the DNS over HTTPS domain that receives DNS requests. Gateway automatically generates this value. - `ecs_support?: boolean` Indicate whether the location must resolve EDNS queries. - `endpoints?: Endpoint | null` Configure the destination endpoints for this location. - `doh: DOHEndpoint` - `enabled?: boolean` Indicate whether the DOH endpoint is enabled for this location. - `networks?: Array | null` 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?: boolean` Specify whether the DOH endpoint requires user identity authentication. - `dot: DOTEndpoint` - `enabled?: boolean` Indicate whether the DOT endpoint is enabled for this location. - `networks?: Array | null` 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. - `ipv4: IPV4Endpoint` - `enabled?: boolean` Indicate whether the IPv4 endpoint is enabled for this location. - `ipv6: IPV6Endpoint` - `enabled?: boolean` Indicate whether the IPV6 endpoint is enabled for this location. - `networks?: Array | null` 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. - `ip?: 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?: string` Show the primary destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. - `ipv4_destination_backup?: string` Show the backup destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. - `max_ttl?: MaxTTL | null` Controls how DNS response TTLs are capped for this location relative to the account `max_ttl_secs` setting. Omitting `max_ttl` on update resets it to `inherit`. - `mode: "inherit" | "override" | "disabled"` `inherit` uses the account `max_ttl_secs`. `override` uses this location's `ttl_secs`. `disabled` leaves returned TTLs unchanged. - `"inherit"` - `"override"` - `"disabled"` - `ttl_secs?: number | null` Location-specific cap on DNS response TTLs, in seconds. Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or `disabled`. - `name?: string` Specify the location name. - `networks?: Array | null` 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?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const location = await client.zeroTrust.gateway.locations.create({ account_id: '699d98642c564d2e855e9661899b7252', name: 'Austin Office Location', }); console.log(location.id); ``` #### Response ```json { "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": { "id": "ed35569b41ce4d1facfe683550f54086", "client_default": false, "created_at": "2014-01-01T05:20:00.12345Z", "dns_destination_ips_id": "0e4a32c6-6fb8-4858-9296-98f51631e8e6", "dns_destination_ipv6_block_id": "b08f7231-d458-495c-98ef-190604c9ee83", "doh_subdomain": "oli3n9zkz5", "ecs_support": false, "endpoints": { "doh": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ], "require_token": true }, "dot": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ] }, "ipv4": { "enabled": true }, "ipv6": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ] } }, "ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "ipv4_destination": "172.64.36.1", "ipv4_destination_backup": "172.64.36.2", "max_ttl": { "mode": "override", "ttl_secs": 3600 }, "name": "Austin Office Location", "networks": [ { "network": "192.0.2.1/32" } ], "updated_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Update a Zero Trust Gateway location `client.zeroTrust.gateway.locations.update(stringlocationID, LocationUpdateParamsparams, RequestOptionsoptions?): Location` **put** `/accounts/{account_id}/gateway/locations/{location_id}` Update a configured Zero Trust Gateway location. ### Parameters - `locationID: string` - `params: LocationUpdateParams` - `account_id: string` Path param - `name: string` Body param: Specify the location name. - `client_default?: boolean` Body param: Indicate whether this location is the default location. - `dns_destination_ips_id?: string` Body param: Specify the identifier of the pair of IPv4 addresses assigned to this location. When creating a location, if this field is absent or set to null, the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned. When updating a location, if this field is absent or set to null, the pre-assigned pair remains unchanged. - `ecs_support?: boolean` Body param: Indicate whether the location must resolve EDNS queries. - `endpoints?: Endpoint | null` Body param: Configure the destination endpoints for this location. - `doh: DOHEndpoint` - `enabled?: boolean` Indicate whether the DOH endpoint is enabled for this location. - `networks?: Array | null` 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?: boolean` Specify whether the DOH endpoint requires user identity authentication. - `dot: DOTEndpoint` - `enabled?: boolean` Indicate whether the DOT endpoint is enabled for this location. - `networks?: Array | null` 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. - `ipv4: IPV4Endpoint` - `enabled?: boolean` Indicate whether the IPv4 endpoint is enabled for this location. - `ipv6: IPV6Endpoint` - `enabled?: boolean` Indicate whether the IPV6 endpoint is enabled for this location. - `networks?: Array | null` 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. - `max_ttl?: MaxTTL | null` Body param: Controls how DNS response TTLs are capped for this location relative to the account `max_ttl_secs` setting. Omitting `max_ttl` on update resets it to `inherit`. - `mode: "inherit" | "override" | "disabled"` `inherit` uses the account `max_ttl_secs`. `override` uses this location's `ttl_secs`. `disabled` leaves returned TTLs unchanged. - `"inherit"` - `"override"` - `"disabled"` - `ttl_secs?: number | null` Location-specific cap on DNS response TTLs, in seconds. Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or `disabled`. - `networks?: Array | null` Body param: 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. ### Returns - `Location` - `id?: string` - `client_default?: boolean` Indicate whether this location is the default location. - `created_at?: string` - `dns_destination_ips_id?: string` Indicate the identifier of the pair of IPv4 addresses assigned to this location. - `dns_destination_ipv6_block_id?: string | null` 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?: string` Specify the DNS over HTTPS domain that receives DNS requests. Gateway automatically generates this value. - `ecs_support?: boolean` Indicate whether the location must resolve EDNS queries. - `endpoints?: Endpoint | null` Configure the destination endpoints for this location. - `doh: DOHEndpoint` - `enabled?: boolean` Indicate whether the DOH endpoint is enabled for this location. - `networks?: Array | null` 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?: boolean` Specify whether the DOH endpoint requires user identity authentication. - `dot: DOTEndpoint` - `enabled?: boolean` Indicate whether the DOT endpoint is enabled for this location. - `networks?: Array | null` 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. - `ipv4: IPV4Endpoint` - `enabled?: boolean` Indicate whether the IPv4 endpoint is enabled for this location. - `ipv6: IPV6Endpoint` - `enabled?: boolean` Indicate whether the IPV6 endpoint is enabled for this location. - `networks?: Array | null` 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. - `ip?: 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?: string` Show the primary destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. - `ipv4_destination_backup?: string` Show the backup destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. - `max_ttl?: MaxTTL | null` Controls how DNS response TTLs are capped for this location relative to the account `max_ttl_secs` setting. Omitting `max_ttl` on update resets it to `inherit`. - `mode: "inherit" | "override" | "disabled"` `inherit` uses the account `max_ttl_secs`. `override` uses this location's `ttl_secs`. `disabled` leaves returned TTLs unchanged. - `"inherit"` - `"override"` - `"disabled"` - `ttl_secs?: number | null` Location-specific cap on DNS response TTLs, in seconds. Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or `disabled`. - `name?: string` Specify the location name. - `networks?: Array | null` 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?: string` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const location = await client.zeroTrust.gateway.locations.update( 'ed35569b41ce4d1facfe683550f54086', { account_id: '699d98642c564d2e855e9661899b7252', name: 'Austin Office Location' }, ); console.log(location.id); ``` #### Response ```json { "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": { "id": "ed35569b41ce4d1facfe683550f54086", "client_default": false, "created_at": "2014-01-01T05:20:00.12345Z", "dns_destination_ips_id": "0e4a32c6-6fb8-4858-9296-98f51631e8e6", "dns_destination_ipv6_block_id": "b08f7231-d458-495c-98ef-190604c9ee83", "doh_subdomain": "oli3n9zkz5", "ecs_support": false, "endpoints": { "doh": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ], "require_token": true }, "dot": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ] }, "ipv4": { "enabled": true }, "ipv6": { "enabled": true, "networks": [ { "network": "2001:85a3::/64" } ] } }, "ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "ipv4_destination": "172.64.36.1", "ipv4_destination_backup": "172.64.36.2", "max_ttl": { "mode": "override", "ttl_secs": 3600 }, "name": "Austin Office Location", "networks": [ { "network": "192.0.2.1/32" } ], "updated_at": "2014-01-01T05:20:00.12345Z" } } ``` ## Delete a Zero Trust Gateway location `client.zeroTrust.gateway.locations.delete(stringlocationID, LocationDeleteParamsparams, RequestOptionsoptions?): LocationDeleteResponse` **delete** `/accounts/{account_id}/gateway/locations/{location_id}` Delete a configured Zero Trust Gateway location. ### Parameters - `locationID: string` - `params: LocationDeleteParams` - `account_id: string` ### Returns - `LocationDeleteResponse = unknown` ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const location = await client.zeroTrust.gateway.locations.delete( 'ed35569b41ce4d1facfe683550f54086', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(location); ``` #### Response ```json { "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": {} } ``` ## Domain Types ### DOH Endpoint - `DOHEndpoint` - `enabled?: boolean` Indicate whether the DOH endpoint is enabled for this location. - `networks?: Array | null` 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?: boolean` Specify whether the DOH endpoint requires user identity authentication. ### DOT Endpoint - `DOTEndpoint` - `enabled?: boolean` Indicate whether the DOT endpoint is enabled for this location. - `networks?: Array | null` 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 - `Endpoint` Configure the destination endpoints for this location. - `doh: DOHEndpoint` - `enabled?: boolean` Indicate whether the DOH endpoint is enabled for this location. - `networks?: Array | null` 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?: boolean` Specify whether the DOH endpoint requires user identity authentication. - `dot: DOTEndpoint` - `enabled?: boolean` Indicate whether the DOT endpoint is enabled for this location. - `networks?: Array | null` 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. - `ipv4: IPV4Endpoint` - `enabled?: boolean` Indicate whether the IPv4 endpoint is enabled for this location. - `ipv6: IPV6Endpoint` - `enabled?: boolean` Indicate whether the IPV6 endpoint is enabled for this location. - `networks?: Array | null` 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. ### IP Network - `IPNetwork` - `network: string` Specify the IP address or IP CIDR. ### IPV4 Endpoint - `IPV4Endpoint` - `enabled?: boolean` Indicate whether the IPv4 endpoint is enabled for this location. ### IPV6 Endpoint - `IPV6Endpoint` - `enabled?: boolean` Indicate whether the IPV6 endpoint is enabled for this location. - `networks?: Array | null` 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. ### IPV6 Network - `IPV6Network` - `network: string` Specify the IPv6 address or IPv6 CIDR. ### Location - `Location` - `id?: string` - `client_default?: boolean` Indicate whether this location is the default location. - `created_at?: string` - `dns_destination_ips_id?: string` Indicate the identifier of the pair of IPv4 addresses assigned to this location. - `dns_destination_ipv6_block_id?: string | null` 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?: string` Specify the DNS over HTTPS domain that receives DNS requests. Gateway automatically generates this value. - `ecs_support?: boolean` Indicate whether the location must resolve EDNS queries. - `endpoints?: Endpoint | null` Configure the destination endpoints for this location. - `doh: DOHEndpoint` - `enabled?: boolean` Indicate whether the DOH endpoint is enabled for this location. - `networks?: Array | null` 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?: boolean` Specify whether the DOH endpoint requires user identity authentication. - `dot: DOTEndpoint` - `enabled?: boolean` Indicate whether the DOT endpoint is enabled for this location. - `networks?: Array | null` 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. - `ipv4: IPV4Endpoint` - `enabled?: boolean` Indicate whether the IPv4 endpoint is enabled for this location. - `ipv6: IPV6Endpoint` - `enabled?: boolean` Indicate whether the IPV6 endpoint is enabled for this location. - `networks?: Array | null` 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. - `ip?: 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?: string` Show the primary destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. - `ipv4_destination_backup?: string` Show the backup destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. - `max_ttl?: MaxTTL | null` Controls how DNS response TTLs are capped for this location relative to the account `max_ttl_secs` setting. Omitting `max_ttl` on update resets it to `inherit`. - `mode: "inherit" | "override" | "disabled"` `inherit` uses the account `max_ttl_secs`. `override` uses this location's `ttl_secs`. `disabled` leaves returned TTLs unchanged. - `"inherit"` - `"override"` - `"disabled"` - `ttl_secs?: number | null` Location-specific cap on DNS response TTLs, in seconds. Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or `disabled`. - `name?: string` Specify the location name. - `networks?: Array | null` 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?: string` ### Location Delete Response - `LocationDeleteResponse = unknown`