Endpoints
All paths are relative to https://api.key2host.com/api/v1/servers/{serverId}. Every request requires a Bearer token with the relevant server scope.
| Method | Path | Scope | Purpose |
|---|---|---|---|
| GET | / | read | Retrieve server information |
| PATCH | / | info.write | Change the name or hostname |
| POST | /actions | control | Start, stop, kill, or reset |
| GET | /tasks?task=… | control | Check a control task |
| GET | /statistics?range=hour | statistics.read | Retrieve historical statistics |
| GET | /network | network.read | Retrieve interfaces and latency |
| GET | /ips | ips.read | Retrieve assigned IP addresses |
| GET | /traffic | traffic.read | Retrieve usage and throttling |
| POST | /traffic/reset | traffic.reset | Reserved; currently HTTP 501 |
| POST | /backups | backups.create | Reserved; currently HTTP 501 |
| PUT | /backups/schedule | backups.configure | Reserved; currently HTTP 501 |
| GET | /backups | backups.read | Reserved; currently HTTP 501 |
| GET | /app | apps.read | Retrieve the installed app and job |
| DELETE | /app | apps.delete | Remove an app and reinstall the OS |
| POST | /app | apps.install | Install 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 status | Meaning |
|---|---|
| 400 | Invalid parameters or missing confirmation |
| 401 | Missing, invalid, disabled, or expired token |
| 403 | Missing scope, locked account, or forbidden change |
| 404 | Server or task not found |
| 409 | Conflicting or active operation |
| 412 | A required condition is not met |
| 429 | Token rate limit reached |
| 500 / 502 | Internal or temporary infrastructure error |
| 501 | Feature is not yet available |