---
title: List virtual networks
---

[Skip to content](#_top)

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

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

[Networks](https://developers.cloudflare.com/api/typescript/resources/zero_trust/subresources/networks)

[Virtual Networks](https://developers.cloudflare.com/api/typescript/resources/zero_trust/subresources/networks/subresources/virtual_networks)

Copy Markdown

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

---

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

# List virtual networks

client.zeroTrust.networks.virtualNetworks.list(VirtualNetworkListParams {account\_id, id, is\_default, 3 more } params, RequestOptionsoptions?): SinglePage< [VirtualNetwork](<https://developers.cloudflare.com/api/typescript/resources/zero_trust#(resource)%20zero_trust.networks.virtual_networks%20%3E%20(model)%20virtual_network%20%3E%20(schema)>) {id, comment, created\_at, 3 more } >

GET/accounts/{account\_id}/teamnet/virtual\_networks

Lists and filters virtual networks in an account.

##### 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 One Networks Write``Cloudflare One Networks Read``Cloudflare Tunnel Write``Cloudflare Tunnel Read`

##### ParametersExpand Collapse

<details>

<summary>

params: VirtualNetworkListParams {account\_id, id, is\_default, 3 more }

</summary>

account\_id: string

Path param: Cloudflare account ID

maxLength32

<a href="#(resource)%20zero_trust.networks.virtual_networks%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

id?: string

Query param: UUID of the virtual network.

formatuuid

<a href="#(resource)%20zero_trust.networks.virtual_networks%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20id">Link to this property</a>

is\_default?: boolean

Query param: If <code>true</code>, only include the default virtual network. If <code>false</code>, exclude the default virtual network. If empty, all virtual networks will be included.

<a href="#(resource)%20zero_trust.networks.virtual_networks%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20is_default">Link to this property</a>

is\_default\_network?: boolean

Query param: If <code>true</code>, only include the default virtual network. If <code>false</code>, exclude the default virtual network. If empty, all virtual networks will be included.

<a href="#(resource)%20zero_trust.networks.virtual_networks%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20is_default_network">Link to this property</a>

is\_deleted?: boolean

Query param: If <code>true</code>, only include deleted virtual networks. If <code>false</code>, exclude deleted virtual networks. If empty, all virtual networks will be included.

<a href="#(resource)%20zero_trust.networks.virtual_networks%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20is_deleted">Link to this property</a>

name?: string

Query param: A user-friendly name for the virtual network.

maxLength256

<a href="#(resource)%20zero_trust.networks.virtual_networks%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20name">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zero_trust.networks.virtual_networks%20%3E%20(method)%20list%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

VirtualNetwork {id, comment, created\_at, 3 more }

</summary>

id: string

UUID of the virtual network.

formatuuid

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

comment: string

Optional remark describing the virtual network.

maxLength256

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

created\_at: string

Timestamp of when the resource was created.

formatdate-time

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

is\_default\_network: boolean

If <code>true</code>, this virtual network is the default for the account.

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

name: string

A user-friendly name for the virtual network.

maxLength256

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

deleted\_at?: string

Timestamp of when the resource was deleted. If <code>null</code>, the resource has not been deleted.

formatdate-time

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

</details>

[Link to this property](<#(resource)%20zero_trust.networks.virtual_networks%20%3E%20(model)%20virtual_network%20%3E%20(schema)>)

### List virtual networks

TypeScript

HTTPTypeScriptPythonGoTerraform

```
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 virtualNetwork of client.zeroTrust.networks.virtualNetworks.list({
  account_id: '699d98642c564d2e855e9661899b7252',
})) {
  console.log(virtualNetwork.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"
      }
    }
  ],
  "result": [
    {
      "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
      "comment": "Staging VPC for data science",
      "created_at": "2021-01-25T18:22:34.317854Z",
      "is_default_network": true,
      "name": "us-east-1-vpc",
      "deleted_at": "2009-11-10T23:00:00Z"
    }
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
```

##### 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"
      }
    }
  ],
  "result": [
    {
      "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
      "comment": "Staging VPC for data science",
      "created_at": "2021-01-25T18:22:34.317854Z",
      "is_default_network": true,
      "name": "us-east-1-vpc",
      "deleted_at": "2009-11-10T23:00:00Z"
    }
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
```