Change the plan
POST/api/v1/vms/{vm_uuid}/resize
Moves the server to another plan on the same hardware. Between a plan and its -dedicated twin the change is live; a plan with other vCPU or memory stops the server and starts it again, usually within a minute. The disk and the addresses stay, and the new price applies from the next hour.
Parameters
| Name | In | Description |
|---|---|---|
| vm_uuid | path, stringrequired | Server id, from Create a VM or List VMs |
Request body
| Field | Type | Description |
|---|---|---|
| vm_class_id | integerrequired | The new plan, from List plans, on the same hardware |
Example request
curl -X POST "https://platform.serverscamp.com/api/v1/vms/$VM_UUID/resize" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"vm_class_id": 50
}'import os, requests
token = os.environ["API_TOKEN"]
vm_uuid = "6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34"
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vms/{vm_uuid}/resize",
headers={"Authorization": f"Bearer {token}"},
json={
"vm_class_id": 50
},
)
r.raise_for_status()
print(r.json())const vmUuid = '6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34';
const r = await fetch(`https://platform.serverscamp.com/api/v1/vms/${vmUuid}/resize`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"vm_class_id": 50
}),
});
console.log(r.status, await r.json());curl -X POST "https://platform.serverscamp.com/api/v1/vms/$VM_UUID/resize" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"vm_class_id": 51
}'import os, requests
token = os.environ["API_TOKEN"]
vm_uuid = "6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34"
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vms/{vm_uuid}/resize",
headers={"Authorization": f"Bearer {token}"},
json={
"vm_class_id": 51
},
)
r.raise_for_status()
print(r.json())const vmUuid = '6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34';
const r = await fetch(`https://platform.serverscamp.com/api/v1/vms/${vmUuid}/resize`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"vm_class_id": 51
}),
});
console.log(r.status, await r.json());Answer
Status 202 with this body.
| Field | Type | Description |
|---|---|---|
| vm_uuid | stringrequired | |
| from_class_name | string, optional | Plan before |
| to_class_name | string, optional | Plan after |
| needs_restart | booleanrequired | The server restarts: the vCPU or memory change. Shared to dedicated of the same size does not restart it |
| step | stringrequired | queued, applying, done or failed |
| started_at | stringrequired | |
| completed_at | string, optional | |
| error | string, optional | What went wrong, when step is failed |
{
"vm_uuid": "6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34",
"from_class_name": "basic-4g",
"to_class_name": "basic-4g-dedicated",
"needs_restart": false,
"step": "queued",
"started_at": "2026-11-01T10:02:11+00:00",
"completed_at": null,
"error": null
}Wait until it is ready
The answer comes at once and the work runs in the background. The job's own status shows how far it got.
Check the status
Ask Plan change status with the server's id; the field to watch is step:
curl "https://platform.serverscamp.com/api/v1/vms/$VM_UUID/resize/status" \
-H "Authorization: Bearer $API_TOKEN"| step | What it means |
|---|---|
queued | Waiting for its turn |
applying | The change runs |
done | Finished |
failed | Something went wrong; the error field says what |
Wait in a loop
Ask every few seconds until it gets there, and stop on an error.
# VM_UUID: vm_uuid of the server, from the answer above
while true; do
JOB=$(curl -s "https://platform.serverscamp.com/api/v1/vms/$VM_UUID/resize/status" -H "Authorization: Bearer $API_TOKEN")
STEP=$(echo "$JOB" | jq -r .step)
echo "$STEP"
[ "$STEP" = done ] && break
[ "$STEP" = failed ] && { echo "$JOB" | jq -r .error; exit 1; }
sleep 5
done# vm_uuid: vm_uuid of the server, from the answer above
import os, time, requests
headers = {"Authorization": f"Bearer {os.environ['API_TOKEN']}"}
while True:
job = requests.get(f"https://platform.serverscamp.com/api/v1/vms/{vm_uuid}/resize/status", headers=headers).json()
print(job["step"])
if job["step"] == "done":
break
if job["step"] == "failed":
raise SystemExit(job["error"])
time.sleep(5)// vmUuid: vm_uuid of the server, from the answer above
const headers = { Authorization: `Bearer ${process.env.API_TOKEN}` };
for (;;) {
const job = await (await fetch(`https://platform.serverscamp.com/api/v1/vms/${vmUuid}/resize/status`, { headers })).json();
console.log(job.step);
if (job.step === 'done') break;
if (job.step === 'failed') throw new Error(job.error);
await new Promise((ok) => setTimeout(ok, 5000));
}The bash version needs jq.
Errors
| Status | When |
|---|---|
400 | A plan on other hardware, or one the account may not have |
401 | No token, or a token that is not valid |
404 | No such server in your account |
409 | The server is busy with another operation |
422 | The body or a parameter is not what the operation takes |
Every operation can also answer 401 without a valid token. All errors