Volume API
Create, attach and grow volumes 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/volumes" \
-H "Authorization: Bearer $API_TOKEN"A volume from scratch
Create a volume with a disk id from List disks (ask with line=v2 for the ones on sale) and poll Get a volume until its state is created. Then attach it to a server, whose id comes from the cloud VM API.
Requests and answers
Bodies are JSON with Content-Type: application/json, and every answer is JSON. A volume changes in the background: create, attach, detach, grow, a disk change and delete answer at once, and Get a volume 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": "Volume is attached to a VM. Detach it first."}| 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: the volume is busy |
422 | The body is not what the operation takes |
429 | Too many of these in a short time |
Operations
Disks
Volumes
- POSTCreate a volume/volumes
- GETList volumes/volumes
- GETGet a volume/volumes/{disk_uuid}
- DELDelete a volume/volumes/{disk_uuid}