Sign up

Delete a VPS

DELETE/api/v1/vps/{vps_uuid}

Deletes the server, its disk and its backups. Billing stops at once, and from then on Get a VPS answers 404 while the host removes the server in the background.

Parameters

NameInDescription
vps_uuidpath, stringrequiredVPS id, from Create a VPS or List VPS

Example request

curl -X DELETE "https://platform.serverscamp.com/api/v1/vps/$VPS_UUID" \
  -H "Authorization: Bearer $API_TOKEN"

Answer

Status 200 with this body.

FieldTypeDescription
vps_uuidstringrequired
statusstringrequiredWhat the server does now; poll Get a VPS to see it finish
{
  "vps_uuid": "12d46f8c-d66e-4163-99aa-1245d5b06e5b",
  "status": "deleting"
}

Wait until it is ready

The answer comes at once. From then on Get a VPS answers 404, and the host removes the server, its disk and its backups in the background within a minute or two.

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"

After the delete it answers 404:

{
  "detail": "VPS not found"
}

Wait in a loop

Ask every few seconds until the answer is 404.

# VPS_UUID: vps_uuid of the server, from the answer above
until [ "$(curl -s -o /dev/null -w '%{http_code}' \
    "https://platform.serverscamp.com/api/v1/vps/$VPS_UUID" -H "Authorization: Bearer $API_TOKEN")" = 404 ]; do
  sleep 5
done
echo deleted

Errors

StatusWhen
401No token, or a token that is not valid
404No such VPS in your account
409The server is busy with another task
422The body or a parameter is not what the operation takes

Every operation can also answer 401 without a valid token. All errors