Resize a Cloud VPS
POST /api/v2/vps/{id}/actions/resize
Change the CPU cores and RAM of a Cloud VPS. Send both values, even when only one changes. It works only for a Cloud VPS: check actions.canResize on GET /api/v2/vps/{id}/details. A regular VPS changes plan with POST /api/v2/vps/{id}/actions/upgrade instead. Disks grow with POST /api/v2/vps/{id}/actions/add-disk and POST /api/v2/vps/{id}/actions/resize-disk.
An increase must fit the account’s Cloud VPS limits from GET /api/v2/vps/payg/limits. Otherwise the call returns 403. When a running VPS needs a restart for the new size, it is restarted. The call then returns 202 with the restart job. Follow it at operation.pollUrl. See Jobs. Otherwise the new size applies at once. The call then returns 200 with the new and the previous values.
Authentication: An API key with the scope write:billing. About keys and scopes
Request
Path parameters
idstringrequiredvps_…).Body
cpuCoresintegerrequiredmemoryGbintegerrequiredExample
curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/resize" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "cpuCores": 4, "memoryGb": 8 }'Responses
200 The new size applies without a restart.
{ "resized": true, "resources": { "cpuCores": 4, "memoryGb": 8 }, "previousResources": { "cpuCores": 2, "memoryGb": 4 }}Response fields
resizedbooleantrue.resourcesobjectcpuCoresintegermemoryGbintegerpreviousResourcesobjectnull values mean unknown.cpuCoresinteger or nullmemoryGbinteger or null202 The new size is set. The running VPS restarts to apply it. Follow the job.
{ "operation": { "status": "queued", "jobId": "job_01hxa3b4c5d6e7f8g9h0j1k2m3", "pollUrl": "/api/jobs/job_01hxa3b4c5d6e7f8g9h0j1k2m3" }}Response fields
operationobjectstatusstringqueued, pending, in_progress.jobIdstring or nullpollUrlstring or nullErrors
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 | The resize is refused. The increase may go over the account’s Cloud VPS limits. The account may not be verified for Cloud VPS. The key holder may not be allowed to place orders. The detail text is generic. |
| 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. |