dots.v2.vpcs.byVpc_Id().subnets.bySubnet_uuid().routes.post()
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.post(body: Route_create, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | RoutesPostResponse>Description
To add a static route to a VPC subnet, send a POST request to
/v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/routes. This route is additional
to the routes the VPC already propagates to the subnet. The server assigns
the route’s id and type.
Droplet targets must use a numeric ID. A Droplet UUID or another invalid
target_urns value returns a 422 response.
Parameters
Path Parameters
vpc_Idstring requiredExample:
997615ce-132d-4bae-9270-9ee21b395e5dThe unique identifier of the VPC.
subnet_uuidstring requiredExample:
4de7ac8b-495b-4884-9a69-1050c6793cd6The unique identifier of the VPC subnet.
Request Body
destinationCidrstring requiredExample:
0.0.0.0/0A valid IPv4 CIDR accepted by the VPC routing product.
targetUrnsarray of strings requiredExample:
["do:droplet:4126873"]The URNs of supported next-hop resources. Droplet targets must use a
numeric ID in the formatdo:droplet:<id>. VPC NAT Gateway targets use
a UUID in the formatdo:nat_gateway:<uuid>.
Request Sample
Response Example
More Information
See /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/routes in the API reference for additional detail on responses, headers, parameters, and more.