dots.v2.volumes.byVolume_id().actions.post()
Generated on 13 Nov 2026
from DoTs version
v1.24.0
Usage
client.v2.volumes.byVolume_id(volume_id).actions.post(body: Volume_action_post_attach | Volume_action_post_detach | Volume_action_post_resize, requestConfiguration?: RequestConfiguration<ActionsRequestBuilderPostQueryParameters>): Promise<undefined | ActionsPostResponse>Description
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
| Attribute | Details |
|---|---|
| type | This must be attach |
| droplet_id | Set to the Droplet’s ID |
| region | Set 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
| Attribute | Details |
|---|---|
| type | This must be detach |
| droplet_id | Set to the Droplet’s ID |
| region | Set to the slug representing the region where the volume is located |
Resize a Volume
| Attribute | Details |
|---|---|
| type | This must be resize |
| size_gigabytes | The new size of the block storage volume in GiB (1024^3) |
| region | Set 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.
Parameters
Path Parameters
volume_idstring requiredExample:
7724db7c-e098-11e5-b522-000f53304e51The ID of the block storage volume.
Query Parameters
perPageinteger optionalExample:
2Number of items returned per page
pageinteger optionalExample:
1Which 'page' of paginated results to return.
Request Body
volume_action_post_attach
typestring requiredThe volume action to initiate.
regionstring optionalThe slug identifier for the region where the resource will initially be available.
dropletIdinteger requiredExample:
11612190The unique identifier for the Droplet the volume will be attached or detached from.
tagsarray of strings or null optionalExample:
["base-image", "prod"]A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags.
Requirestag:createscope.
volume_action_post_detach
typestring requiredThe volume action to initiate.
regionstring optionalThe slug identifier for the region where the resource will initially be available.
dropletIdinteger requiredExample:
11612190The unique identifier for the Droplet the volume will be attached or detached from.
volume_action_post_resize
typestring requiredThe volume action to initiate.
regionstring optionalThe slug identifier for the region where the resource will initially be available.
sizeGigabytesinteger requiredThe new size of the block storage volume in GiB (1024^3).
Request Sample
Response Example
More Information
See /v2/volumes/{volume_id}/actions in the API reference for additional detail on responses, headers, parameters, and more.