Skip to content

Delete a volume

DELETE /api/v2/volumes/{id}

Deletes a detached volume and the data on it. This cannot be undone. The volume must be detached: actions.canDelete on GET /api/v2/volumes/{id} is true. An attached volume returns 400 volume_attached. Detach it first with POST /api/v2/volumes/{id}/actions/detach and wait for the job to finish. Right after a detach the API can still see the volume as attached for up to 30 seconds. The volume is gone when the call returns 204. Its size no longer counts toward your disk quota.

Authentication: An API key with the scope write:storage. About keys and scopes

Request

Path parameters

idstringrequired
The volume ID (vol_…).

Example

DELETE /api/v2/volumes/{id}
curl -X DELETE "https://cloud.hostup.se/api/v2/volumes/vol_01hxa3b4c5d6e7f8g9h0j1k2m3" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

204 The volume and its data are deleted.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400volume_attached: the volume is attached to a VPS. Detach it first.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404volume_not_found: no volume with that ID on your account.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.