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
idstringrequiredThe volume ID (
vol_…).Example
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.
{ "operation": { "status": "queued", "jobId": "job_01hxa3b4c5d6e7f8g9h0j1k2m3", "pollUrl": "/api/jobs/job_01hxa3b4c5d6e7f8g9h0j1k2m3" }}Response fields
operationobjectThe queued job.
statusstringThe job state when the call returns. One of
queued, pending, in_progress.jobIdstring or nullThe job ID (
job_…).pollUrlstring or nullThe 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.
| 400 | volume_not_attached: the volume is not attached to a VPS. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | volume_not_found: no volume with that ID on your account. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |