Skip to content

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

idstringrequired
The VPS ID (vps_…).

Body (optional)

forceboolean
Cut the power if the operating system does not shut down. Default false.

Example

POST /api/v2/vps/{id}/actions/shutdown
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"

Responses

202 The shutdown is queued. Follow the job.

Response 202
{
"operation": {
"status": "queued",
"jobId": "job_01hxa3b4c5d6e7f8g9h0j1k2m3",
"pollUrl": "/api/jobs/job_01hxa3b4c5d6e7f8g9h0j1k2m3"
}
}
Response fields
operationobject
statusstring
Where the job is. A 202 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.
jobIdstring
pollUrlstring or null
Where to poll the job while it runs. null when status is already completed or failed.

Errors

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

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller; code is vps_not_found.
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.