Digital Ocean VP Cs API

[VPCs (virtual private clouds)](https://docs.digitalocean.com/products/networking/vpc/) allow you to create virtual networks containing resources that can communicate with each other in full isolation using private IP addresses. By sending requests to the `/v2/vpcs` endpoint, you can create, configure, list, and delete custom VPCs as well as retrieve information about the resources assigned to them.

GitHub OpenAPI
Business capability
IT Infrastructure Management BC-600.50

Operations 21

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /v2/vpcs List VPCs · Get vpcs #
Ask an LLM
“Which virtual private clouds exist in my account?”
“Can I see all my VPCs at once?”
Tell an agent
List all my VPCs.
Show every virtual private cloud in my account.
POST /v2/vpcs Create a VPC · Create vpcs #
Ask an LLM
“How do I create a new virtual private cloud?”
“Can I set a region and size when creating a VPC?”
Tell an agent
Create a new VPC.
Set up a fresh virtual private cloud.
GET /v2/vpcs/{vpc_id} Get a VPC · Get vpcs by vpc id #
Ask an LLM
“What are the details of one VPC?”
“Can I look up a VPC by its ID?”
Tell an agent
Show VPC {vpc_id}.
Get the details of virtual private cloud {vpc_id}.
PUT /v2/vpcs/{vpc_id} Replace a VPC · Replace vpcs by vpc id #
Ask an LLM
“Can I overwrite a VPC's settings entirely?”
“What does a full replace of a VPC do?”
Tell an agent
Replace VPC {vpc_id}.
Overwrite the entire virtual private cloud {vpc_id}.
PATCH /v2/vpcs/{vpc_id} Update a VPC · Update vpcs by vpc id #
Ask an LLM
“Can I rename a VPC or change its settings?”
“How do I edit an existing virtual private cloud?”
Tell an agent
Update VPC {vpc_id}.
Rename or change the settings of virtual private cloud {vpc_id}.
DELETE /v2/vpcs/{vpc_id} Delete a VPC · Delete vpcs by vpc id #
Ask an LLM
“How do I delete a VPC?”
“Can I remove a virtual private cloud I no longer need?”
Tell an agent destructive · confirm first
Delete VPC {vpc_id}.
Remove virtual private cloud {vpc_id}.
GET /v2/vpcs/{vpc_id}/members List a VPC's members · Get vpcs by vpc id members #
Ask an LLM
“Which resources are members of a VPC?”
“Can I see what a virtual private cloud contains?”
Tell an agent
Show the members of VPC {vpc_id}.
List the resources in virtual private cloud {vpc_id}.
GET /v2/vpcs/{vpc_id}/peerings List VPC peerings · Get vpcs by vpc id peerings #
Ask an LLM
“Which VPC peering connections exist for a VPC?”
“Can I see the peering relationships of a virtual private cloud?”
Tell an agent
Show the peerings of VPC {vpc_id}.
List the VPC peering connections for virtual private cloud {vpc_id}.
POST /v2/vpcs/{vpc_id}/peerings Create a VPC peering connection · Create vpcs by vpc id peerings #
Ask an LLM
“How do I peer two VPCs together?”
“Can I create a VPC peering connection for a virtual private cloud?”
Tell an agent
Create a peering connection on VPC {vpc_id}.
Set up a VPC peering connection for virtual private cloud {vpc_id}.
PATCH /v2/vpcs/{vpc_id}/peerings/{vpc_peering_id} Update a VPC peering connection · Update vpcs by vpc id peerings by vpc peering id #
Ask an LLM
“Can I change an existing VPC peering connection?”
“How do I edit a VPC peering relationship?”
Tell an agent
Update peering connection {vpc_peering_id} on VPC {vpc_id}.
Edit VPC peering connection {vpc_peering_id} of virtual private cloud {vpc_id}.
GET /v2/vpcs/{vpc_uuid}/routes List a VPC's routes · Get vpcs by vpc uuid routes #
Ask an LLM
“What routes are configured on a VPC?”
“Can I see the routing table of a virtual private cloud?”
Tell an agent
Show the routes on VPC {vpc_uuid}.
List the routing table of virtual private cloud {vpc_uuid}.
GET /v2/vpcs/{vpc_uuid}/subnets List a VPC's subnets · Get vpcs by vpc uuid subnets #
Ask an LLM
“Which subnets are in a VPC?”
“Can I see the subnets of a virtual private cloud?”
Tell an agent
Show the subnets of VPC {vpc_uuid}.
List the subnets in virtual private cloud {vpc_uuid}.
POST /v2/vpcs/{vpc_uuid}/subnets Create a subnet in a VPC · Create vpcs by vpc uuid subnets #
Ask an LLM
“How do I add a subnet to a VPC?”
“Can I create a new subnet inside a virtual private cloud?”
Tell an agent
Create a subnet in VPC {vpc_uuid}.
Add a new subnet to virtual private cloud {vpc_uuid}.
GET /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid} Get one subnet on a VPC · Get vpcs by vpc uuid subnets by subnet uuid #
Ask an LLM
“What are the details of a subnet inside a VPC?”
“Can I look up a single subnet by its UUID?”
Tell an agent
Get subnet {subnet} on VPC {vpc}.
Show details of VPC subnet {subnet} in {vpc}.
PATCH /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid} Rename a subnet on a VPC · Update vpcs by vpc uuid subnets by subnet uuid #
Ask an LLM
“Can I rename a subnet inside a VPC?”
“What's the way to update a VPC subnet's settings?”
Tell an agent
Rename VPC subnet {subnet} in {vpc}.
Update the settings of subnet {subnet} on VPC {vpc}.
DELETE /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid} Delete a VPC subnet · Delete vpcs by vpc uuid subnets by subnet uuid #
Ask an LLM
“How do I delete a subnet from a VPC?”
“Can I remove a subnet I no longer need?”
Tell an agent destructive · confirm first
Delete subnet {subnet_uuid} from VPC {vpc_uuid}.
Remove subnet {subnet_uuid} in virtual private cloud {vpc_uuid}.
GET /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/members List members of a VPC subnet · Get vpcs by vpc uuid subnets by subnet uuid members #
Ask an LLM
“Which load balancers and droplets live in a subnet?”
“Who are the members of this VPC subnet?”
Tell an agent
List members of subnet {subnet} on VPC {vpc}.
Show the load balancers and droplets in VPC subnet {subnet}.
GET /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/routes List routes on a VPC subnet · Get vpcs by vpc uuid subnets by subnet uuid routes #
Ask an LLM
“Which custom routes exist on a VPC subnet?”
“What destinations does a subnet route to?”
Tell an agent
List routes on subnet {subnet} of VPC {vpc}.
Show custom routes for VPC subnet {subnet}.
POST /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/routes Add a custom route to a VPC subnet · Create vpcs by vpc uuid subnets by subnet uuid routes #
Ask an LLM
“Can I add a custom route to a subnet?”
“How do I route traffic for a VPC CIDR through a subnet?”
Tell an agent
Add a route to subnet {subnet} on VPC {vpc}.
Create a custom route in VPC subnet {subnet}.
PATCH /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/routes/{route_uuid} Update a route in a VPC subnet · Update vpcs by vpc uuid subnets by subnet uuid routes by route uuid #
Ask an LLM
“How do I change the destination of a route in a VPC subnet?”
“Can I edit a custom route on a subnet?”
Tell an agent
Update route {route_uuid} in subnet {subnet_uuid} of VPC {vpc_uuid}.
Change the destination of route {route_uuid} on subnet {subnet_uuid} in VPC {vpc_uuid}.
DELETE /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/routes/{route_uuid} Delete a custom route from a VPC subnet · Delete vpcs by vpc uuid subnets by subnet uuid routes by route uuid #
Ask an LLM
“Can I remove a custom route from a VPC subnet?”
“What's the way to delete one subnet route?”
Tell an agent destructive · confirm first
Delete route {route} from subnet {subnet} on VPC {vpc}.
Remove custom route {route} from VPC subnet {subnet}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/digital-ocean:digital-ocean-vpcs-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

digital-ocean-vpcs-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: DigitalOcean Vpcs API
  version: '2.0'
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    name: DigitalOcean API Team
    email: api-engineering@digitalocean.com
  termsOfService: https://www.digitalocean.com/legal/terms-of-service-agreement/
servers:
- url: https://api.digitalocean.com
  description: production
security:
- bearer_auth: []
tags:
- name: Vpcs
paths:
  /v2/vpcs:
    get:
      $ref: resources/vpcs/vpcs_list.yml
      tags:
      - Vpcs
      summary: Get vpcs
      x-summary-source: derived
      operationId: getV2Vpcs
      x-operation-id-source: derived
    post:
      $ref: resources/vpcs/vpcs_create.yml
      tags:
      - Vpcs
      summary: Create vpcs
      x-summary-source: derived
      operationId: postV2Vpcs
      x-operation-id-source: derived
  /v2/vpcs/{vpc_id}:
    get:
      $ref: resources/vpcs/vpcs_get.yml
      tags:
      - Vpcs
      summary: Get vpcs by vpc id
      x-summary-source: derived
      operationId: getV2VpcsByVpcId
      x-operation-id-source: derived
    put:
      $ref: resources/vpcs/vpcs_update.yml
      tags:
      - Vpcs
      summary: Replace vpcs by vpc id
      x-summary-source: derived
      operationId: putV2VpcsByVpcId
      x-operation-id-source: derived
    patch:
      $ref: resources/vpcs/vpcs_patch.yml
      tags:
      - Vpcs
      summary: Update vpcs by vpc id
      x-summary-source: derived
      operationId: patchV2VpcsByVpcId
      x-operation-id-source: derived
    delete:
      $ref: resources/vpcs/vpcs_delete.yml
      tags:
      - Vpcs
      summary: Delete vpcs by vpc id
      x-summary-source: derived
      operationId: deleteV2VpcsByVpcId
      x-operation-id-source: derived
  /v2/vpcs/{vpc_id}/members:
    get:
      $ref: resources/vpcs/vpcs_list_members.yml
      tags:
      - Vpcs
      summary: Get vpcs by vpc id members
      x-summary-source: derived
      operationId: getV2VpcsByVpcIdMembers
      x-operation-id-source: derived
  /v2/vpcs/{vpc_id}/peerings:
    get:
      $ref: resources/vpcs/vpcs_list_peerings.yml
      tags:
      - Vpcs
      summary: Get vpcs by vpc id peerings
      x-summary-source: derived
      operationId: getV2VpcsByVpcIdPeerings
      x-operation-id-source: derived
    post:
      $ref: resources/vpcs/vpcs_create_peerings.yml
      tags:
      - Vpcs
      summary: Create vpcs by vpc id peerings
      x-summary-source: derived
      operationId: postV2VpcsByVpcIdPeerings
      x-operation-id-source: derived
  /v2/vpcs/{vpc_id}/peerings/{vpc_peering_id}:
    patch:
      $ref: resources/vpcs/vpcs_update_peerings.yml
      tags:
      - Vpcs
      summary: Update vpcs by vpc id peerings by vpc peering id
      x-summary-source: derived
      operationId: patchV2VpcsByVpcIdPeeringsByVpcPeeringId
      x-operation-id-source: derived
  /v2/vpcs/{vpc_uuid}/routes:
    get:
      $ref: resources/routes/vpc_routes_list.yml
      tags:
      - Vpcs
      summary: Get vpcs by vpc uuid routes
      x-summary-source: derived
      operationId: getV2VpcsByVpcUuidRoutes
      x-operation-id-source: derived
  /v2/vpcs/{vpc_uuid}/subnets:
    get:
      $ref: resources/vpc_subnets/vpc_subnets_list.yml
      tags:
      - Vpcs
      summary: Get vpcs by vpc uuid subnets
      x-summary-source: derived
      operationId: getV2VpcsByVpcUuidSubnets
      x-operation-id-source: derived
    post:
      $ref: resources/vpc_subnets/vpc_subnets_create.yml
      tags:
      - Vpcs
      summary: Create vpcs by vpc uuid subnets
      x-summary-source: derived
      operationId: postV2VpcsByVpcUuidSubnets
      x-operation-id-source: derived
  /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}:
    get:
      $ref: resources/vpc_subnets/vpc_subnets_get.yml
      tags:
      - Vpcs
      summary: Get vpcs by vpc uuid subnets by subnet uuid
      x-summary-source: derived
      operationId: getV2VpcsByVpcUuidSubnetsBySubnetUuid
      x-operation-id-source: derived
    patch:
      $ref: resources/vpc_subnets/vpc_subnets_update.yml
      tags:
      - Vpcs
      summary: Update vpcs by vpc uuid subnets by subnet uuid
      x-summary-source: derived
      operationId: patchV2VpcsByVpcUuidSubnetsBySubnetUuid
      x-operation-id-source: derived
    delete:
      $ref: resources/vpc_subnets/vpc_subnets_delete.yml
      tags:
      - Vpcs
      summary: Delete vpcs by vpc uuid subnets by subnet uuid
      x-summary-source: derived
      operationId: deleteV2VpcsByVpcUuidSubnetsBySubnetUuid
      x-operation-id-source: derived
  /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/members:
    get:
      $ref: resources/vpc_subnets/vpc_subnets_list_members.yml
      tags:
      - Vpcs
      summary: Get vpcs by vpc uuid subnets by subnet uuid members
      x-summary-source: derived
      operationId: getV2VpcsByVpcUuidSubnetsBySubnetUuidMembers
      x-operation-id-source: derived
  /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/routes:
    get:
      $ref: resources/routes/subnet_routes_list.yml
      tags:
      - Vpcs
      summary: Get vpcs by vpc uuid subnets by subnet uuid routes
      x-summary-source: derived
      operationId: getV2VpcsByVpcUuidSubnetsBySubnetUuidRoutes
      x-operation-id-source: derived
    post:
      $ref: resources/routes/subnet_routes_create.yml
      tags:
      - Vpcs
      summary: Create vpcs by vpc uuid subnets by subnet uuid routes
      x-summary-source: derived
      operationId: postV2VpcsByVpcUuidSubnetsBySubnetUuidRoutes
      x-operation-id-source: derived
  /v2/vpcs/{vpc_uuid}/subnets/{subnet_uuid}/routes/{route_uuid}:
    patch:
      $ref: resources/routes/subnet_routes_update.yml
      tags:
      - Vpcs
      summary: Update vpcs by vpc uuid subnets by subnet uuid routes by route uuid
      x-summary-source: derived
      operationId: patchV2VpcsByVpcUuidSubnetsBySubnetUuidRoutesByRouteUuid
      x-operation-id-source: derived
    delete:
      $ref: resources/routes/subnet_routes_delete.yml
      tags:
      - Vpcs
      summary: Delete vpcs by vpc uuid subnets by subnet uuid routes by route uuid
      x-summary-source: derived
      operationId: deleteV2VpcsByVpcUuidSubnetsBySubnetUuidRoutesByRouteUuid
      x-operation-id-source: derived
components:
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: '## OAuth Authentication


        In order to interact with the DigitalOcean API, you or your application must

        authenticate.


        The DigitalOcean API handles this through OAuth, an open standard for

        authorization. OAuth allows you to delegate access to your account.

        Scopes can be used to grant full access, read-only access, or access to

        a specific set of endpoints.


        You can generate an OAuth token by visiting the [Apps & API](https://cloud.digitalocean.com/account/api/tokens)

        section of the DigitalOcean control panel for your account.


        An OAuth token functions as a complete authentication request. In effect, it

        acts as a substitute for a username and password pair.


        Because of this, it is absolutely **essential** that you keep your OAuth

        tokens secure. In fact, upon generation, the web interface will only display

        each token a single time in order to prevent the token from being compromised.


        DigitalOcean access tokens begin with an identifiable prefix in order to

        distinguish them from other similar tokens.


        - `dop_v1_` for personal access tokens generated in the control panel

        - `doo_v1_` for tokens generated by applications using [the OAuth flow](https://docs.digitalocean.com/reference/api/oauth-api/)

        - `dor_v1_` for OAuth refresh tokens


        ### Scopes


        Scopes act like permissions assigned to an API token. These permissions

        determine what actions the token can perform. You can create API

        tokens that grant read-only access, full access, or limited access to

        specific endpoints by using custom scopes.


        Generally, scopes are designed to match HTTP verbs and common CRUD

        operations (Create, Read, Update, Delete).


        | HTTP Verb | CRUD Operation | Scope |

        |---|---|---|

        | GET | Read | `<resource>:read` |

        | POST | Create | `<resource>:create` |

        | PUT/PATCH | Update | `<resource>:update` |

        | DELETE | Delete | `<resource>:delete` |


        For example, creating a new Droplet by making a `POST` request to the

        `/v2/droplets` endpoint requires the `droplet:create` scope while

        listing Droplets by making a `GET` request to the `/v2/droplets`

        endpoint requires the `droplet:read` scope.


        Each endpoint below specifies which scope is required to access it when

        using custom scopes.


        ### How to Authenticate with OAuth


        In order to make an authenticated request, include a bearer-type

        `Authorization` header containing your OAuth token. All requests must be

        made over HTTPS.


        ### Authenticate with a Bearer Authorization Header


        ```

        curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT"

        ```

        '
    inference_bearer_auth:
      type: http
      scheme: bearer
      description: '## OAuth Authentication


        In order to interact with the DigitalOcean API, you or your application must

        authenticate.


        The DigitalOcean API handles this through OAuth, an open standard for

        authorization. OAuth allows you to delegate access to your account.

        Scopes can be used to grant full access, read-only access, or access to

        a specific set of endpoints.


        You can generate an OAuth token by visiting the [Apps & API](https://cloud.digitalocean.com/account/api/tokens)

        section of the DigitalOcean control panel for your account.


        An OAuth token functions as a complete authentication request. In effect, it

        acts as a substitute for a username and password pair.


        Because of this, it is absolutely **essential** that you keep your OAuth

        tokens secure. In fact, upon generation, the web interface will only display

        each token a single time in order to prevent the token from being compromised.


        DigitalOcean access tokens begin with an identifiable prefix in order to

        distinguish them from other similar tokens.


        - `dop_v1_` for personal access tokens generated in the control panel

        - `doo_v1_` for tokens generated by applications using [the OAuth flow](https://docs.digitalocean.com/reference/api/oauth-api/)

        - `dor_v1_` for OAuth refresh tokens


        ### Authenticate with a Bearer Authorization Header


        **Serverless Inference:**


        ```

        curl -X POST -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://inference.do-ai.run/v1/chat/completions"

        ```


        **Agent Inference:**


        ```

        curl -X POST -H "Authorization: Bearer $AGENT_ACCESS_KEY" "https://{your-agent-url}.agents.do-ai.run/v1/chat/completions?agent=true"

        ```


        **Note:** Agent Inference APIs use an `agent_access_key` (endpoint access

        key) instead of a DigitalOcean OAuth token. The `agent_access_key` is

        provided when you provision an agent endpoint and is scoped to that

        specific agent. It is not interchangeable with DigitalOcean OAuth tokens

        (`dop_v1_*`, `doo_v1_*`, `dor_v1_*`), which are used with Serverless

        Inference and the control-plane API at `https://api.digitalocean.com`.

        '
x-tagGroups:
- name: Public APIs
  tags:
  - Public APIs Introduction
  - 1-Click Applications
  - Account
  - Actions
  - Add-Ons
  - Action Gateway
  - Action Gateway Data Plane
  - Agent Platform API
  - Apps
  - Billing
  - Block Storage
  - Block Storage Actions
  - BYOIP Prefixes
  - CDN Endpoints
  - Certificates
  - Container Registry
  - Container Registries
  - Databases
  - Dedicated Inference
  - Domain Records
  - Domains
  - Droplet Actions
  - Droplets
  - Droplet Autoscale Pools
  - Firewalls
  - Floating IP Actions
  - Floating IPs
  - Functions
  - Harness Runtime
  - Image Actions
  - Images
  - Insights
  - Kubernetes
  - Load Balancers
  - MicroVMs [Public Preview]
  - Monitoring
  - NFS
  - NFS Actions
  - Organizations
  - Partner Network Connect
  - Project Resources
  - Projects
  - Regions
  - Reserved IP Actions
  - Reserved IPs
  - Reserved IPv6
  - Reserved IPv6 Actions
  - Security
  - Signals
  - Sizes
  - Snapshots
  - Spaces Keys
  - SSH Keys
  - Tags
  - Uptime
  - Vector Databases
  - VPC NAT Gateways
  - VPC Peerings
  - VPC Routes [Public Preview]
  - VPC Subnets [Public Preview]
  - VPCs
- name: Inference APIs
  tags:
  - Inference Introduction
  - Agent Inference
  - Batch Inference
  - Embeddings
  - Serverless Inference