1. Docs
  2. API reference
  3. Servers API

Servers API

Create, list, show, power, rebuild, resize, open a console for and delete VPS with the PikoStack hosting API.

The server object#

{
  "id": "5f0c1b9e-8a3d-4c3e-9b8f-0d6f3b2a7c11",
  "name": "vps1001",
  "hostname": "web.example.com",
  "status": "running",
  "plan_id": "piko.small",
  "template_id": "ubuntu-24.04",
  "ipv4": ["203.0.113.25"],
  "ipv6": [],
  "owner": "whmcs:1001",
  "suspended": false,
  "tags": {"client_id": "42"},
  "created_at": "2026-11-23T10:12:44Z",
  "updated_at": "2026-11-23T10:13:20Z"
}

status is one of building, running, stopped, suspended, rebooting, rebuilding, resizing, deleting, error or unknown. When it is error, fault explains why.

Create a server#

POST /api/v1/servers · admin

Field Required Description
name Yes Display name, unique per owner
hostname No Guest hostname (FQDN allowed); defaults to the name
plan_id Yes A plan from GET /api/v1/plans
template_id Yes A template key from GET /api/v1/templates
password One of password or ssh_keys Root password. Hashed by pikod; never stored or sent in clear text
ssh_keys One of password or ssh_keys Public keys for root
user_data No Extra cloud-init user data
owner No Free-form owner reference, for example whmcs:1001
tags No String key-value pairs
curl -sS -H "Authorization: Bearer $TOKEN" -d '{
  "name": "vps1001", "hostname": "web.example.com",
  "plan_id": "piko.small", "template_id": "ubuntu-24.04",
  "password": "Str0ng-Passw0rd", "ssh_keys": ["ssh-ed25519 AAAA... me"],
  "owner": "whmcs:1001", "tags": {"client_id": "42"}
}' http://127.0.0.1:8090/api/v1/servers

Returns 202 Accepted with the server in status building. Poll it until it is running. On first boot the QEMU guest agent is installed.

List servers#

GET /api/v1/servers?owner=<owner> · readonly

Returns servers created through the hosting API. Filter by owner to see one customer's or one billing system's servers.

Show a server#

GET /api/v1/servers/{id} · readonly

Power actions#

POST /api/v1/servers/{id}/actions/{action} · admin

action is one of start, stop, reboot, hard_reboot, suspend or resume. Returns 202 Accepted.

curl -sS -X POST -H "Authorization: Bearer $TOKEN" http://127.0.0.1:8090/api/v1/servers/$ID/actions/reboot

Rebuild (reinstall)#

POST /api/v1/servers/{id}/rebuild · admin

{"template_id": "debian-12", "password": "N3w-Passw0rd", "ssh_keys": ["ssh-ed25519 AAAA..."]}

All data on the root disk is replaced. IP addresses are kept.

Resize#

POST /api/v1/servers/{id}/resize · admin

{"plan_id": "piko.medium"}

The server restarts with the new plan. Disks can grow but not shrink. Resizing to the current plan is accepted and does nothing.

Console#

POST /api/v1/servers/{id}/console · admin

{"type": "novnc", "url": "https://panel.example.com:6080/vnc_auto.html?path=..."}

The URL is valid for one session. Open it in a browser or embed it in an iframe.

Delete#

DELETE /api/v1/servers/{id} · admin

Returns 202 Accepted. The server, its root disk and its ports are removed.

Something unclear or wrong on this page? Tell us. © 2026 PikoStack.