KVM Server API

Endpoints

Scopes, parameters, and responses of the KVM Server API.

All paths are relative to https://api.key2host.com/api/v1/servers/{serverId}. Every request requires a Bearer token with the relevant server scope.

MethodPathScopePurpose
GET/readRetrieve server information
PATCH/info.writeChange the name or hostname
POST/actionscontrolStart, stop, kill, or reset
GET/tasks?task=…controlCheck a control task
GET/statistics?range=hourstatistics.readRetrieve historical statistics
GET/networknetwork.readRetrieve interfaces and latency
GET/ipsips.readRetrieve assigned IP addresses
GET/traffictraffic.readRetrieve usage and throttling
POST/traffic/resettraffic.resetReserved; currently HTTP 501
POST/backupsbackups.createReserved; currently HTTP 501
PUT/backups/schedulebackups.configureReserved; currently HTTP 501
GET/backupsbackups.readReserved; currently HTTP 501
GET/appapps.readRetrieve the installed app and job
DELETE/appapps.deleteRemove an app and reinstall the OS
POST/appapps.installInstall an app and reinstall the OS

Server information

GET / returns id, name, status, cpuCores, ramGb, diskGb, os, powerState, and uptimeSeconds. Power values are null when the infrastructure cannot be reached. IP addresses are available through /ips.

PATCH / accepts exactly one change:

{ "kind": "name", "value": "Production server" }

Use kind: "hostname" for the hostname. The server must be running and its guest agent available.

Server control

POST /actions accepts start, stop, reset, or kill. Stop, reset, and kill also require confirmed: true. The response is 202 Accepted with a task ID. Poll GET /tasks?task=… until finished is true, then evaluate success.

Statistics and network

The range for /statistics can be hour, day, week, or month. Values are historical averages, not a live stream. CPU and RAM use percentages; network and disk I/O use bytes per second.

/network returns interfaces and a latency measurement. A missing ping response does not prove that a server is offline because a firewall may block it.

Traffic

Traffic combines upload and download. The current monthly limit is 1 TB. The regular speed is 1,000 Mbit/s and is reduced to 250 Mbit/s after the limit is reached until the monthly reset.

Apps

App installation and removal erase all existing server data. Use a new UUID as requestId and set confirmDataLoss: true. Only one app can be installed at a time. Track progress through GET /app.

Errors

HTTP statusMeaning
400Invalid parameters or missing confirmation
401Missing, invalid, disabled, or expired token
403Missing scope, locked account, or forbidden change
404Server or task not found
409Conflicting or active operation
412A required condition is not met
429Token rate limit reached
500 / 502Internal or temporary infrastructure error
501Feature is not yet available