Delete a volume. This operation is permanent and cannot be undone.
Deleting a volume permanently removes all data stored in it. This action cannot be undone.
Path parameters
The unique ID of the volume to delete
Response
Returns a 204 No Content status on successful deletion.
Error responses
Volume not found with the specified ID
Volume is currently mounted to one or more sandboxes and cannot be deleted
{
"statusCode": 409,
"message": "Volume is currently in use by sandboxes",
"error": "Conflict"
}
Example request
curl -X DELETE https://api.daytona.io/volumes/vol_abc123xyz \
-H "Authorization: Bearer YOUR_API_KEY"
Before deleting
Make sure to unmount the volume from all sandboxes before deletion:
- List all sandboxes using the volume
- Stop or delete those sandboxes
- Then delete the volume
Alternative: Get volume ID by name
If you only have the volume name, first get the volume details to find its ID:
# Get volume by name
curl https://api.daytona.io/volumes/by-name/my-data-volume \
-H "Authorization: Bearer YOUR_API_KEY"
# Response includes ID: "vol_abc123xyz"
# Delete by ID
curl -X DELETE https://api.daytona.io/volumes/vol_abc123xyz \
-H "Authorization: Bearer YOUR_API_KEY"