---
title: Get Zero Trust Gateway location details
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/python)

[Zero Trust](https://developers.cloudflare.com/api/python/resources/zero_trust)

[Gateway](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/gateway)

[Locations](https://developers.cloudflare.com/api/python/resources/zero_trust/subresources/gateway/subresources/locations)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Get Zero Trust Gateway location details

zero\_trust.gateway.locations.get(strlocation\_id, LocationGetParams\*\*kwargs) -> [Location](<https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)>)

GET/accounts/{account\_id}/gateway/locations/{location\_id}

Get a single Zero Trust Gateway location.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



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

**Example:**<code>X-Auth-Email: user@example.com</code>

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

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`Cloudflare Zero Trust Secure DNS Locations Write``Zero Trust Read``Zero Trust Write`

##### ParametersExpand Collapse

account\_id: str

Specify the Cloudflare account identifier.

[Link to this property](<#(resource)%20zero_trust.gateway.locations%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20account_id%20%3E%20(schema)>)

location\_id: str

[Link to this property](<#(resource)%20zero_trust.gateway.locations%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20location_id%20%3E%20(schema)>)

##### ReturnsExpand Collapse

<details>

<summary>

class Location: …

</summary>

id: Optional\[str]

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

client\_default: Optional\[bool]

Indicate whether this location is the default location.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20client_default">Link to this property</a>

created\_at: Optional\[datetime]

formatdate-time

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

dns\_destination\_ips\_id: Optional\[str]

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

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20dns_destination_ips_id">Link to this property</a>

dns\_destination\_ipv6\_block\_id: Optional\[str]

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.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20dns_destination_ipv6_block_id">Link to this property</a>

doh\_subdomain: Optional\[str]

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

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20doh_subdomain">Link to this property</a>

ecs\_support: Optional\[bool]

Indicate whether the location must resolve EDNS queries.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20ecs_support">Link to this property</a>

<details>

<summary>

endpoints: Optional\[Endpoint]

Configure the destination endpoints for this location.

</summary>

<details>

<summary>

doh: <a href="https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20doh_endpoint%20%3E%20(schema)">DOHEndpoint</a>

</summary>

enabled: Optional\[bool]

Indicate whether the DOH endpoint is enabled for this location.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20doh%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20doh_endpoint%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

<details>

<summary>

networks: Optional\[List\[<a href="https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20ip_network%20%3E%20(schema)">IPNetwork</a>]]

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.

</summary>

network: str

Specify the IP address or IP CIDR.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20doh%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20ip_network%20%3E%20(schema)%20%3E%20(property)%20network">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20doh%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20doh_endpoint%20%3E%20(schema)%20%3E%20(property)%20networks">Link to this property</a>

require\_token: Optional\[bool]

Specify whether the DOH endpoint requires user identity authentication.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20doh%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20doh_endpoint%20%3E%20(schema)%20%3E%20(property)%20require_token">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20endpoints%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20doh">Link to this property</a>

<details>

<summary>

dot: <a href="https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20dot_endpoint%20%3E%20(schema)">DOTEndpoint</a>

</summary>

enabled: Optional\[bool]

Indicate whether the DOT endpoint is enabled for this location.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20dot%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20dot_endpoint%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

<details>

<summary>

networks: Optional\[List\[<a href="https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20ip_network%20%3E%20(schema)">IPNetwork</a>]]

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.

</summary>

network: str

Specify the IP address or IP CIDR.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20dot%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20ip_network%20%3E%20(schema)%20%3E%20(property)%20network">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20dot%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20dot_endpoint%20%3E%20(schema)%20%3E%20(property)%20networks">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20endpoints%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20dot">Link to this property</a>

<details>

<summary>

ipv4: <a href="https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20ipv4_endpoint%20%3E%20(schema)">IPV4Endpoint</a>

</summary>

enabled: Optional\[bool]

Indicate whether the IPv4 endpoint is enabled for this location.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20ipv4%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20ipv4_endpoint%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20endpoints%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20ipv4">Link to this property</a>

<details>

<summary>

ipv6: <a href="https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20ipv6_endpoint%20%3E%20(schema)">IPV6Endpoint</a>

</summary>

enabled: Optional\[bool]

Indicate whether the IPV6 endpoint is enabled for this location.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20ipv6%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20ipv6_endpoint%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

<details>

<summary>

networks: Optional\[List\[<a href="https://developers.cloudflare.com/api/python/resources/zero_trust#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20ipv6_network%20%3E%20(schema)">IPV6Network</a>]]

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.

</summary>

network: str

Specify the IPv6 address or IPv6 CIDR.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20ipv6%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20ipv6_network%20%3E%20(schema)%20%3E%20(property)%20network">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20ipv6%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20ipv6_endpoint%20%3E%20(schema)%20%3E%20(property)%20networks">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20endpoints%20%2B%20(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20endpoint%20%3E%20(schema)%20%3E%20(property)%20ipv6">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20endpoints">Link to this property</a>

ip: Optional\[str]

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.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20ip">Link to this property</a>

ipv4\_destination: Optional\[str]

Show the primary destination IPv4 address from the pair identified dns\_destination\_ips\_id. This field read-only.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20ipv4_destination">Link to this property</a>

ipv4\_destination\_backup: Optional\[str]

Show the backup destination IPv4 address from the pair identified dns\_destination\_ips\_id. This field read-only.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20ipv4_destination_backup">Link to this property</a>

<details>

<summary>

max\_ttl: Optional\[MaxTTL]

Controls how DNS response TTLs are capped for this location relative to the account <code>max_ttl_secs</code> setting. Omitting <code>max_ttl</code> on update resets it to <code>inherit</code>.

</summary>

<details>

<summary>

mode: Literal\["inherit", "override", "disabled"]

<code>inherit</code> uses the account <code>max_ttl_secs</code>. <code>override</code> uses this location’s <code>ttl_secs</code>. <code>disabled</code> leaves returned TTLs unchanged.

</summary>

One of the following:

"inherit"

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20max_ttl%20%3E%20(property)%20mode%20%3E%20(member)%200">Link to this property</a>

"override"

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20max_ttl%20%3E%20(property)%20mode%20%3E%20(member)%201">Link to this property</a>

"disabled"

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20max_ttl%20%3E%20(property)%20mode%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20max_ttl%20%3E%20(property)%20mode">Link to this property</a>

ttl\_secs: Optional\[int]

Location-specific cap on DNS response TTLs, in seconds. Required when <code>mode</code> is <code>override</code>. Must be omitted when <code>mode</code> is <code>inherit</code> or <code>disabled</code>.

maximum36000

minimum60

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20max_ttl%20%3E%20(property)%20ttl_secs">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20max_ttl">Link to this property</a>

name: Optional\[str]

Specify the location name.

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

<details>

<summary>

networks: Optional\[List\[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.

</summary>

network: str

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

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20networks%20%3E%20(items)%20%3E%20(property)%20network">Link to this property</a>

</details>

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20networks">Link to this property</a>

updated\_at: Optional\[datetime]

formatdate-time

<a href="#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)%20%3E%20(property)%20updated_at">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.gateway.locations%20%3E%20(model)%20location%20%3E%20(schema)>)

### Get Zero Trust Gateway location details

Python

HTTPTypeScriptPythonGoTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
location = client.zero_trust.gateway.locations.get(
    location_id="ed35569b41ce4d1facfe683550f54086",
    account_id="699d98642c564d2e855e9661899b7252",
)
print(location.id)
```

200 example

```
{
  "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"
  }
}
```

##### Returns Examples

200 example

```
{
  "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"
  }
}
```