Cloud VM API
Create and manage cloud servers over HTTP with an API token. Every operation has its own page with its fields, examples, an example answer and the errors it gives.
OpenAPI file
Everything in this reference as one OpenAPI 3.1 file: operations, fields, examples and errors. Import it into Postman or Insomnia, generate a client from it, or give it to an LLM to write code against the API.
Download openapi.json
Base URL
https://platform.serverscamp.com/api/v1Authentication
Make a token in the Cloud Panel under Settings, API tokens and send it with every request. A token acts for its account in full, so keep it as you would a password.
curl "https://platform.serverscamp.com/api/v1/vms" \
-H "Authorization: Bearer $API_TOKEN"A server from scratch
Create a VM takes ids: a plan from List plans, a disk from List disks, an image from List images, a network from List networks and a key from List SSH keys. Ask for plans and disks with line=v2 to get the ones on sale. Then Create a VM and poll Get a VM until its status is active.
Requests and answers
Bodies are JSON with Content-Type: application/json, and every answer is JSON. A server changes in the background: create, delete, power, a plan change, a reinstall and disk changes answer at once, and Get a VM or the job's status shows when the work is done. Prices are in millicents: 10,000 make 1 EUR, and a month is 720 hours.
Errors
An error has an HTTP status and a detail that says what went wrong in words you can show to a person. On a 422 it is a list instead, one entry for each field that is not right.
{"detail": "The server is busy with another operation"}| Status | Meaning |
|---|---|
400 | A value that is not accepted; detail says which |
401 | No token, or a token that is not valid |
402 | The balance does not cover what was asked |
403 | A limit of the account is reached; request more on the Limits page |
404 | No such thing in your account |
409 | Not possible right now: no free capacity, or the server is busy |
422 | The body is not what the operation takes |
429 | Too many of these in a short time |
Operations
Plans, disks and images
- GETList plans/vm-classes
- GETList disks/storage-classes
- GETList images/vm-templates
- GETList networks/network
- GETList security groups/security-groups
Servers
- POSTCreate a VM/vms
- GETList VMs/vms
- GETGet a VM/vms/{vm_uuid}
- PATCHRename and tag/vms/{vm_uuid}
- DELDelete a VM/vms/{vm_uuid}
Power
Plan, disk and reinstall
- POSTChange the plan/vms/{vm_uuid}/resize
- GETPlan change status/vms/{vm_uuid}/resize/status
- POSTGrow the disk/vms/{vm_uuid}/disk/resize
- POSTChange the disk/vms/{vm_uuid}/disk/change-class
- POSTReinstall/vms/{vm_uuid}/reinstall
- GETReinstall status/vms/{vm_uuid}/reinstall/status
Addresses
- POSTAdd a public address/vms/{vm_uuid}/public-ip
- DELRemove the public address/vms/{vm_uuid}/public-ip
- PUTSet reverse DNS/vms/{vm_uuid}/dns/ptr