v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_Block Storage Actions

Initiate A Block Storage Action By Volume Id

To initiate an action on a block storage volume by Id, send a POST request to ~/v2/volumes/$VOLUME_ID/actions. The body should contain the appropriate attributes for the respective action.

Attach a Block Storage Volume to a Droplet

AttributeDetails
typeThis must be attach
droplet_idSet to the Droplet's ID
regionSet to the slug representing the region where the volume is located

Each volume may only be attached to a single Droplet. However, up to fifteen volumes may be attached to a Droplet at a time. Pre-formatted volumes will be automatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018 when attached. On older Droplets, additional configuration is required.

Remove a Block Storage Volume from a Droplet

AttributeDetails
typeThis must be detach
droplet_idSet to the Droplet's ID
regionSet to the slug representing the region where the volume is located

Resize a Volume

AttributeDetails
typeThis must be resize
size_gigabytesThe new size of the block storage volume in GiB (1024^3)
regionSet to the slug representing the region where the volume is located

Volumes may only be resized upwards. The maximum size for a volume is 16TiB.

post/v2/volumes/{volume_id}/actions

Path parameters

volume_idstring uuid required

The ID of the block storage volume.

Query parameters

per_pageinteger

Number of items returned per page

pageinteger

Which 'page' of paginated results to return.

Request body

OR
OR

Example request

{
  "type": "attach",
  "region": "nyc3",
  "droplet_id": 11612190,
  "tags": [
    "base-image",
    "prod"
  ]
}

Response

The response will be an object with a key called action. The value of this will be an object that contains the standard volume action attributes

Example response

{
  "action": {
    "type": "create",
    "resource_id": 3164444,
    "id": 36804636,
    "status": "completed",
    "started_at": "2020-11-14T16:29:21Z",
    "completed_at": "2020-11-14T16:30:06Z",
    "resource_type": "droplet",
    "region": {
      "name": "New York 3",
      "slug": "nyc3",
      "features": [
        "private_networking",
        "backups",
        "ipv6",
        "metadata",
        "install_agent",
        "storage",
        "image_transfer"
      ],
      "available": true,
      "sizes": [
        "s-1vcpu-1gb",
        "s-1vcpu-2gb",
        "s-1vcpu-3gb",
        "s-2vcpu-2gb",
        "s-3vcpu-1gb",
        "s-2vcpu-4gb",
        "s-4vcpu-8gb",
        "s-6vcpu-16gb",
        "s-8vcpu-32gb",
        "s-12vcpu-48gb",
        "s-16vcpu-64gb",
        "s-20vcpu-96gb",
        "s-24vcpu-128gb",
        "s-32vcpu-192g"
      ]
    },
    "region_slug": "nyc3"
  }
}