Shut down a VPS
POST /api/v2/vps/{id}/actions/shutdown
Ask the operating system on a VPS to shut down cleanly. The shutdown is graceful by default. If the system does not respond, send {"force": true} to cut the power instead. When you know from the start that you want a forced power-off, use POST /api/v2/vps/{id}/actions/stop. Check actions.canShutdown on GET /api/v2/vps/{id}/details first.
The call returns 202 with a job. Follow it at operation.pollUrl until it finishes. See Jobs. If the same action is already queued for the VPS, you get that job back. The call returns 403 while the VPS is still being set up. It does the same while another operation such as a backup, a restore or another power action runs on it.
Authentication: An API key with the scope power:vm. About keys and scopes
Request
Path parameters
idstringrequiredvps_…).Body (optional)
forcebooleanfalse.Example
curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/shutdown" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json"curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/shutdown" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "force": true }'Responses
202 The shutdown is queued. Follow the job.
{ "operation": { "status": "queued", "jobId": "job_01hxa3b4c5d6e7f8g9h0j1k2m3", "pollUrl": "/api/jobs/job_01hxa3b4c5d6e7f8g9h0j1k2m3" }}Response fields
operationobjectstatusstring202 Accepted response only has pending, queued or in_progress. completed and failed appear when you poll pollUrl. They also appear in a 200 OK response when the action finished during the request. One of pending, queued, in_progress, completed, failed.jobIdstringpollUrlstring or nullnull when status is already completed or failed.Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller; code is vps_not_found. |
| 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. |