Skip to content

Detach a volume

POST /api/v2/volumes/{id}/actions/detach

Detaches a volume from the VPS it is attached to. The volume and its data are kept. It becomes available and can be attached again or deleted. The volume must be attached: actions.canDetach on GET /api/v2/volumes/{id} is true. Send no body. The call answers 202 with a job. Follow it as described in Jobs.

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

Request

Path parameters

idstringrequired
The volume ID (vol_…).

Example

POST /api/v2/volumes/{id}/actions/detach
curl -X POST "https://cloud.hostup.se/api/v2/volumes/vol_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/detach" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json"

Responses

202 The detach is queued as a job.

Response 202
{
"operation": {
"status": "queued",
"jobId": "job_01hxa3b4c5d6e7f8g9h0j1k2m3",
"pollUrl": "/api/jobs/job_01hxa3b4c5d6e7f8g9h0j1k2m3"
}
}
Response fields
operationobject
The queued job.
statusstring
The job state when the call returns. One of queued, pending, in_progress.
jobIdstring or null
The job ID (job_…).
pollUrlstring or null
The path to poll for the job’s state. Put https://cloud.hostup.se in front of it.

Errors

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

400volume_not_attached: the volume is not attached to a VPS.
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.