Create a VPS
Creates a server and starts it, usually in about a minute; poll Get a VPS until its status is running. The hostname, DNS name and reverse DNS are made from the name with a random suffix, for example web-1-a1b2c3.vm.scamp.pro. Give ssh_key_ids, a root password, or both. The balance has to cover the first month of the plan; the first hour is charged at once and then every hour after it. Send an Idempotency-Key header to retry safely: the same key within 24 hours answers with the same server instead of making a second one.
Parameters
| Name | In | Description |
|---|---|---|
| Idempotency-Key | header, string, optional | Any string of yours, up to 200 characters. The same key within 24 hours answers with the server the first request made instead of making a second one. |
Request body
| Field | Type | Description |
|---|---|---|
| name | stringrequired | The server's name: 3 to 24 lowercase letters, digits and hyphens, starting with a letter, e.g. web-1 |
| hostname | string, optional | <name>-<6 hex>.vm.scamp.pro as the panel previewed it (hostname, DNS name and reverse DNS); missing or not matching the name, a new one |
| plan_id | stringrequired | A plan id from GET /vps/plans |
| image | stringrequired | An image id from GET /vps/images |
| ssh_key_ids | list of integer | SSH keys saved in your account |
| password | string, optional | Root password |
| backups | boolean | Daily backups, adds the plan's backup share to the price |
Example request
curl -X POST "https://platform.serverscamp.com/api/v1/vps" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "web-1",
"plan_id": "vps2-1",
"image": "ubuntu-26.04",
"ssh_key_ids": [42]
}'import os, requests
token = os.environ["API_TOKEN"]
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vps",
headers={"Authorization": f"Bearer {token}"},
json={
"name": "web-1",
"plan_id": "vps2-1",
"image": "ubuntu-26.04",
"ssh_key_ids": [42]
},
)
r.raise_for_status()
print(r.json())const r = await fetch(`https://platform.serverscamp.com/api/v1/vps`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "web-1",
"plan_id": "vps2-1",
"image": "ubuntu-26.04",
"ssh_key_ids": [42]
}),
});
console.log(r.status, await r.json());curl -X POST "https://platform.serverscamp.com/api/v1/vps" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "db-1",
"plan_id": "vps2-4",
"image": "debian-13",
"ssh_key_ids": [42, 57],
"backups": true
}'import os, requests
token = os.environ["API_TOKEN"]
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vps",
headers={"Authorization": f"Bearer {token}"},
json={
"name": "db-1",
"plan_id": "vps2-4",
"image": "debian-13",
"ssh_key_ids": [42, 57],
"backups": True
},
)
r.raise_for_status()
print(r.json())const r = await fetch(`https://platform.serverscamp.com/api/v1/vps`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "db-1",
"plan_id": "vps2-4",
"image": "debian-13",
"ssh_key_ids": [42, 57],
"backups": true
}),
});
console.log(r.status, await r.json());curl -X POST "https://platform.serverscamp.com/api/v1/vps" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "test-1",
"plan_id": "vps2-075",
"image": "rocky-10",
"password": "change-me-to-a-long-one"
}'import os, requests
token = os.environ["API_TOKEN"]
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vps",
headers={"Authorization": f"Bearer {token}"},
json={
"name": "test-1",
"plan_id": "vps2-075",
"image": "rocky-10",
"password": "change-me-to-a-long-one"
},
)
r.raise_for_status()
print(r.json())const r = await fetch(`https://platform.serverscamp.com/api/v1/vps`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "test-1",
"plan_id": "vps2-075",
"image": "rocky-10",
"password": "change-me-to-a-long-one"
}),
});
console.log(r.status, await r.json());curl -X POST "https://platform.serverscamp.com/api/v1/vps" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "web-2",
"plan_id": "vps2-1",
"image": "almalinux-10",
"ssh_key_ids": [42],
"password": "change-me-to-a-long-one"
}'import os, requests
token = os.environ["API_TOKEN"]
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vps",
headers={"Authorization": f"Bearer {token}"},
json={
"name": "web-2",
"plan_id": "vps2-1",
"image": "almalinux-10",
"ssh_key_ids": [42],
"password": "change-me-to-a-long-one"
},
)
r.raise_for_status()
print(r.json())const r = await fetch(`https://platform.serverscamp.com/api/v1/vps`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "web-2",
"plan_id": "vps2-1",
"image": "almalinux-10",
"ssh_key_ids": [42],
"password": "change-me-to-a-long-one"
}),
});
console.log(r.status, await r.json());curl -X POST "https://platform.serverscamp.com/api/v1/vps" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Idempotency-Key: web-1-2026-10-23" \
-H "Content-Type: application/json" \
-d '{
"name": "web-1",
"plan_id": "vps2-1",
"image": "ubuntu-26.04",
"ssh_key_ids": [42]
}'import os, requests
token = os.environ["API_TOKEN"]
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vps",
headers={"Authorization": f"Bearer {token}", "Idempotency-Key": "web-1-2026-10-23"},
json={
"name": "web-1",
"plan_id": "vps2-1",
"image": "ubuntu-26.04",
"ssh_key_ids": [42]
},
)
r.raise_for_status()
print(r.json())const r = await fetch(`https://platform.serverscamp.com/api/v1/vps`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json', 'Idempotency-Key': 'web-1-2026-10-23' },
body: JSON.stringify({
"name": "web-1",
"plan_id": "vps2-1",
"image": "ubuntu-26.04",
"ssh_key_ids": [42]
}),
});
console.log(r.status, await r.json());Got no answer, a timeout or a dropped connection? Send the same request with the same key: it answers with the server the first one made, and no second server is created.
Answer
Status 201 with this body.
| Field | Type | Description |
|---|---|---|
| vps_uuid | stringrequired | VPS id |
| status | stringrequired | Always queued: poll Get a VPS until it is running |
| hostname | stringrequired | Hostname, DNS name and reverse DNS of the server |
| ipv4 | string, optional | Public IPv4 address |
| ipv6_prefix | string, optional | IPv6 /56 |
{
"vps_uuid": "12d46f8c-d66e-4163-99aa-1245d5b06e5b",
"status": "queued",
"hostname": "web-1-a1b2c3.vm.scamp.pro",
"ipv4": "185.236.9.61",
"ipv6_prefix": "2a01:ea05:0:f00::/56"
}Wait until it is ready
The answer comes at once and the work runs in the background, usually for a minute or two. Get a VPS shows how far it got in its status field.
Check the status
Ask Get a VPS with the server's id:
curl "https://platform.serverscamp.com/api/v1/vps/$VPS_UUID" \
-H "Authorization: Bearer $API_TOKEN"The answer carries the whole server; the field to watch is status:
{
"vps_uuid": "12d46f8c-d66e-4163-99aa-1245d5b06e5b",
"name": "web-1",
"status": "configuring",
"ipv4": "185.236.9.61",
"error": null
}| status | What it means |
|---|---|
queued | Waiting for its turn on the host |
cloning | The system image is copied to the server's disk |
configuring | Disk size, network, addresses, keys and password are set |
starting | The server boots |
running | Ready. SSH answers once the system has booted, a few seconds later |
error | Something went wrong; the error field says what. Delete the server and create it again |
Wait in a loop
Ask every few seconds until the status is the one you wait for, and stop on error.
# VPS_UUID: vps_uuid of the server, from the answer above
WANT=running
while true; do
VPS=$(curl -s "https://platform.serverscamp.com/api/v1/vps/$VPS_UUID" -H "Authorization: Bearer $API_TOKEN")
STATUS=$(echo "$VPS" | jq -r .status)
echo "$STATUS"
[ "$STATUS" = "$WANT" ] && break
[ "$STATUS" = error ] && { echo "$VPS" | jq -r .error; exit 1; }
sleep 5
done
curl -s "https://platform.serverscamp.com/api/v1/vps/$VPS_UUID" -H "Authorization: Bearer $API_TOKEN" | jq -r '"ssh root@" + .ipv4'# vps_uuid: vps_uuid of the server, from the answer above
import os, time, requests
headers = {"Authorization": f"Bearer {os.environ['API_TOKEN']}"}
want = "running"
while True:
vps = requests.get(f"https://platform.serverscamp.com/api/v1/vps/{vps_uuid}", headers=headers).json()
print(vps["status"])
if vps["status"] == want:
break
if vps["status"] == "error":
raise SystemExit(vps["error"])
time.sleep(5)
print(f"ssh root@{vps['ipv4']}")// vpsUuid: vps_uuid of the server, from the answer above
const headers = { Authorization: `Bearer ${process.env.API_TOKEN}` };
const want = 'running';
let vps;
for (;;) {
vps = await (await fetch(`https://platform.serverscamp.com/api/v1/vps/${vpsUuid}`, { headers })).json();
console.log(vps.status);
if (vps.status === want) break;
if (vps.status === 'error') throw new Error(vps.error);
await new Promise((ok) => setTimeout(ok, 5000));
}
console.log(`ssh root@${vps.ipv4}`);The bash version needs jq.
Errors
| Status | When |
|---|---|
400 | A name, image, plan or password that is not accepted |
401 | No token, or a token that is not valid |
402 | The balance does not cover the first month |
403 | The VPS limit of the account is reached |
409 | The plan is out of stock |
422 | The body or a parameter is not what the operation takes |
Every operation can also answer 401 without a valid token. All errors