---
title: Update a tunnel route
---

[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)

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

Copy Markdown

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

---

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

# Update a tunnel route

client.zeroTrust.networks.routes.edit(stringrouteID, RouteEditParams {account\_id, comment, network, 2 more } params, RequestOptionsoptions?): [Route](<https://developers.cloudflare.com/api/typescript/resources/zero_trust#(resource)%20zero_trust.networks.routes%20%3E%20(model)%20route%20%3E%20(schema)>) {id, comment, created\_at, 4 more }

PATCH/accounts/{account\_id}/teamnet/routes/{route\_id}

Updates an existing private network route in an account. The fields that are meant to be updated should be provided in the body of the request.

##### 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 Tunnel Write`

##### ParametersExpand Collapse

routeID: string

UUID of the route.

maxLength36

[Link to this property](<#(resource)%20zero_trust.networks.routes%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20route_id%20%3E%20(schema)>)

<details>

<summary>

params: RouteEditParams {account\_id, comment, network, 2 more }

</summary>

account\_id: string

Path param: Cloudflare account ID

maxLength32

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

comment?: string

Body param: Optional remark describing the route.

maxLength100

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

network?: string

Body param: The private IPv4 or IPv6 range connected by the route, in CIDR notation.

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

tunnel\_id?: string

Body param: UUID of the tunnel.

formatuuid

maxLength36

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

virtual\_network\_id?: string

Body param: UUID of the virtual network.

formatuuid

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

</details>

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

##### ReturnsExpand Collapse

<details>

<summary>

Route {id, comment, created\_at, 4 more }

</summary>

id?: string

UUID of the route.

maxLength36

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

comment?: string

Optional remark describing the route.

maxLength100

<a href="#(resource)%20zero_trust.networks.routes%20%3E%20(model)%20route%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.routes%20%3E%20(model)%20route%20%3E%20(schema)%20%3E%20(property)%20created_at">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.routes%20%3E%20(model)%20route%20%3E%20(schema)%20%3E%20(property)%20deleted_at">Link to this property</a>

network?: string

The private IPv4 or IPv6 range connected by the route, in CIDR notation.

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

tunnel\_id?: string

UUID of the tunnel.

formatuuid

maxLength36

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

virtual\_network\_id?: string

UUID of the virtual network.

formatuuid

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

</details>

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

### Update a tunnel route

TypeScript

HTTPTypeScriptPythonGoTerraform

```
import Cloudflare from 'cloudflare';

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

const route = await client.zeroTrust.networks.routes.edit('f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', {
  account_id: '699d98642c564d2e855e9661899b7252',
});

console.log(route.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": "Example comment for this route.",
    "created_at": "2021-01-25T18:22:34.317854Z",
    "deleted_at": "2009-11-10T23:00:00Z",
    "network": "172.16.0.0/16",
    "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
    "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"
  },
  "success": true
}
```

##### 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": "Example comment for this route.",
    "created_at": "2021-01-25T18:22:34.317854Z",
    "deleted_at": "2009-11-10T23:00:00Z",
    "network": "172.16.0.0/16",
    "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
    "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"
  },
  "success": true
}
```