---
title: How to Manage Routes (public)
description: View a VPC network&#39;s routes and create, update, and delete static routes on its subnets using the DigitalOcean API.
product: Networking
url: https://docs.digitalocean.com/products/networking/vpc/how-to/manage-subnet-routes/
last_updated: "2026-09-22"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# How to Manage Routes (public)

A Virtual Private Cloud (VPC) is a private network interface for collections of DigitalOcean resources. VPC networks are inaccessible from the public internet and other VPC networks, and traffic on them doesn’t count against bandwidth usage. You can link VPC networks to each other using VPC peering connections.

**Note**:

  VPC subnets and routes are in [public preview](https://docs.digitalocean.com/platform/product-lifecycle/index.html.md#public-preview) and available to all customers without opting in from the **Feature Preview** page. During the public preview, you manage subnets and routes with the DigitalOcean API. The Control Panel does not support them yet.

[Routes](https://docs.digitalocean.com/products/networking/vpc/concepts/subnets-and-routes/index.html.md) determine how traffic from a VPC or subnet reaches its destination. VPC-scoped routes are read-only. On a subnet, you can create static routes that direct traffic to a target you manage, such as a Droplet acting as a firewall or VPN gateway. During the public preview, routes are available through the DigitalOcean API only.

## Prerequisites

- [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API.
- The ID of the VPC network and, for subnet routes, the ID of the subnet. Retrieve them using the [`/v2/vpcs`](https://docs.digitalocean.com/reference/api/reference/vpcs/index.html.md#vpcs_list) and `/v2/vpcs/<vpc-id>/subnets` endpoints. See [How to Manage VPC Subnets](https://docs.digitalocean.com/products/networking/vpc/how-to/manage-subnets/index.html.md).

## List VPC Routes

To list the routes that apply to an entire VPC network, send a `GET` request to the `/v2/vpcs/<vpc-id>/routes` endpoint, replacing `<vpc-id>` with your VPC’s ID:

```shell
curl -X GET \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  "https://api.digitalocean.com/v2/vpcs/<vpc-id>/routes"
```

The response is paginated and lists each route’s ID, type, destination CIDR, target URNs, and whether it is modifiable. For example, when you create a subnet, DigitalOcean creates a VPC-scoped route to the subnet’s IP range:

```json
Output
{
  "routes": [
    {
      "id": "f0e1d2c3-b4a5-6789-0fed-cba987654321",
      "type": "STATIC",
      "destination_cidr": "192.168.11.0/24",
      "target_urns": ["do:vpc_subnet:4de7ac8b-495b-4884-9a69-1050c6793cd6"],
      "modifiable": false,
      "created_at": "2026-07-30T10:00:00Z"
    }
  ],
  "meta": {
    "total": 1
  }
}
```

VPC-scoped routes are read-only. You cannot create, update, or delete routes at the VPC scope. To add your own routes, use subnet routes instead.

## List Subnet Routes

To list the routes for a subnet, send a `GET` request to the `/v2/vpcs/<vpc-id>/subnets/<subnet-id>/routes` endpoint:

```shell
curl -X GET \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  "https://api.digitalocean.com/v2/vpcs/<vpc-id>/subnets/<subnet-id>/routes"
```

The response includes both the VPC-scoped routes propagated into the subnet’s effective routing and any routes defined on the subnet itself. Routes with `modifiable` set to `true` are static routes you created on the subnet and can update or delete. Routes with `modifiable` set to `false` are managed by DigitalOcean, including `DYNAMIC` routes and static routes created by products like DigitalOcean Kubernetes (DOKS).

## Create a Subnet Route

To create a static route on a subnet, send a `POST` request to the `/v2/vpcs/<vpc-id>/subnets/<subnet-id>/routes` endpoint. The request body requires a `destination_cidr` (an IPv4 CIDR) and `target_urns` referencing a supported next hop type, such as a Droplet. The `target_urns` field accepts a list, but routes currently support only one target:

```shell
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  -d '{
    "destination_cidr": "0.0.0.0/0",
    "target_urns": ["do:droplet:14aa1d1b-e6ab-4ccb-bb10-dade56fcb8ec"]
}' \
  "https://api.digitalocean.com/v2/vpcs/<vpc-id>/subnets/<subnet-id>/routes"
```

The server assigns the route’s ID and type. Subnet routes do not replace VPC-scoped routes; they are additional to the routes the VPC already propagates to the subnet.

## Update a Subnet Route

To change the target of a static route you created, send a `PATCH` request to the `/v2/vpcs/<vpc-id>/subnets/<subnet-id>/routes/<route-id>` endpoint with the new `target_urns`:

```shell
curl -X PATCH \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  -d '{
    "target_urns": ["do:droplet:aa5c334c-eab4-4bde-ae21-daed56fcb9ec"]
}' \
  "https://api.digitalocean.com/v2/vpcs/<vpc-id>/subnets/<subnet-id>/routes/<route-id>"
```

The request fails if the route is not a user-created static subnet route.

## Delete a Subnet Route

To delete a static route you created, send a `DELETE` request to the `/v2/vpcs/<vpc-id>/subnets/<subnet-id>/routes/<route-id>` endpoint:

```shell
curl -X DELETE \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  "https://api.digitalocean.com/v2/vpcs/<vpc-id>/subnets/<subnet-id>/routes/<route-id>"
```

A successful request returns a `204` status code with no response body. The server rejects the request if the route is managed by DigitalOcean.