dots.v2.vpcs.byVpc_Id().subnets.bySubnet_uuid().routes.byRoute_uuid().patch()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.vpcs.byVpc_Id(vpc_Id).subnets.bySubnet_uuid(subnet_uuid).routes.byRoute_uuid(route_uuid).patch(body: Route_update, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | WithRoute_uuPatchResponse>

Description

To update the next hop for a user-defined VPC subnet route, send a PATCH request to /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/routes/{route_uuid}. The destination_cidr cannot be changed.

Droplet targets must use a numeric ID. A Droplet UUID or another invalid target_urns value returns a 422 response.

Parameters

Path Parameters

vpc_Id string required

Example: 997615ce-132d-4bae-9270-9ee21b395e5d

The unique identifier of the VPC.

subnet_uuid string required

Example: 4de7ac8b-495b-4884-9a69-1050c6793cd6

The unique identifier of the VPC subnet.

route_uuid string required

Example: f0e1d2c3-b4a5-6789-0fed-cba987654321

The unique identifier of the route.

Request Body

targetUrns array of strings required

Example: ["do:droplet:4126873"]

The URNs of supported next-hop resources. Droplet targets must use a
numeric ID in the format do:droplet:<id>. VPC NAT Gateway targets use
a UUID in the format do:nat_gateway:<uuid>.

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.vpcs
    .byVpc_Id("997615ce-132d-4bae-9270-9ee21b395e5d").subnets
    .bySubnet_uuid("4de7ac8b-495b-4884-9a69-1050c6793cd6").routes
    .byRoute_uuid("f0e1d2c3-b4a5-6789-0fed-cba987654321").patch({
    targetUrns: [
        "do:droplet:4126873",
    ],
});

Response Example

Show Response Example
{
  "route": {
    "id": "f0e1d2c3-b4a5-6789-0fed-cba987654321",
    "type": "STATIC",
    "destination_cidr": "0.0.0.0/0",
    "target_urns": [
      "do:droplet:4126873"
    ],
    "modifiable": true,
    "created_at": "2026-01-14T10:05:00Z"
  }
}

More Information

See /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/routes/{route_uuid} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.