Skip to content

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

idstringrequired
The VPS ID (vps_…).

Body

cpuCoresintegerrequired
Number of CPU cores. 1 to 32. 1 to 32.
memoryGbintegerrequired
RAM in GB. 1 to 256. 1 to 256.

Example

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

Response 200
{
"resized": true,
"resources": {
"cpuCores": 4,
"memoryGb": 8
},
"previousResources": {
"cpuCores": 2,
"memoryGb": 4
}
}
Response fields
resizedboolean
Always true.
resourcesobject
CPU cores and RAM now.
cpuCoresinteger
memoryGbinteger
previousResourcesobject
CPU cores and RAM before the change. null values mean unknown.
cpuCoresinteger or null
memoryGbinteger or null

202 The new size is set. The running VPS restarts to apply it. Follow the job.

Response 202
{
"operation": {
"status": "queued",
"jobId": "job_01hxa3b4c5d6e7f8g9h0j1k2m3",
"pollUrl": "/api/jobs/job_01hxa3b4c5d6e7f8g9h0j1k2m3"
}
}
Response fields
operationobject
statusstring
Job status. One of queued, pending, in_progress.
jobIdstring or null
The job ID.
pollUrlstring or null
Where to read the job.

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.
403The 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.
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.