Skip to content
Docs

Compute API

Manage virtual machines and everything around them (SSH keys, security groups, snapshots, backups, private networks, and startup scripts) under /api/compute.

All endpoints require authentication.

Create a VM

Terminal
curl -X POST https://edge.network/api/compute/vms \
  -H "Authorization: Bearer ek_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "web-01",
    "region": "london",
    "osTemplate": "ubuntu-24.04",
    "vcpu": 2,
    "ram": 4,
    "disk": 80,
    "sshKeyIds": ["key_abc123"],
    "setupScript": "#!/bin/bash\napt update"
  }'
FieldRequiredDescription
nameYes1–64 characters: letters, digits and hyphens
regionYesRegion id from GET /api/compute/regions
osTemplateYesTemplate id from GET /api/compute/os-templates
vcpu / ram / diskYesvCPUs (1–128), RAM in GB (1–512), disk in GB (10–10000)
sshKeyIdsNoSSH key ids to attach at first boot
securityGroupIdsNoSecurity group ids to attach
passwordNoRoot password (min 8 chars). Omit to have one generated and returned once.
setupScriptNoBash script to run on first boot. See Startup scripts for the library.

Returns 201:

JSON
{
  "vm": {
    "id": "vm_xyz789",
    "name": "web-01",
    "status": "provisioning",
    "region": "london",
    "vcpu": 2,
    "ram": 4,
    "disk": 80,
    "os": { "name": "Ubuntu 24.04" },
    "network": { "publicIp": "pending" },
    "createdAt": "2026-07-31T15:04:05Z"
  },
  "generatedPassword": "..."
}

VMs

EndpointDescription
GET /api/compute/vmsList VMs. Returns { vms }
GET /api/compute/vms/:idGet a VM. Returns { vm }
PATCH /api/compute/vms/:idRename. Body: { "name": "..." }
DELETE /api/compute/vms/:idDestroy the VM
POST /api/compute/vms/:id/start | stop | restart | resetPower actions. Each returns the updated { vm }
POST /api/compute/vms/:id/suspend | resumeSuspend / resume
POST /api/compute/vms/:id/resizeChange specs. Body: { vcpu?, ram?, disk? }
POST /api/compute/vms/:id/reinstallReinstall the OS. Body: { osId }
POST /api/compute/vms/:id/passwordChange the root password
POST /api/compute/vms/:id/hostnameChange the hostname

Stats, metrics and console

EndpointDescription
GET /api/compute/vms/:id/statsLive CPU / RAM / disk / network usage
GET /api/compute/vms/:id/metrics?period=24hMetric history. period is 1h, 6h, 24h or 7d
POST /api/compute/vms/:id/consoleCreate a VNC console session (returns session token + password)
GET /api/compute/vms/:id/eventsRecent lifecycle events for one VM
GET /api/compute/vms/:id/bandwidth?month=2026-07Monthly bandwidth usage

SSH keys and security groups

EndpointDescription
GET | POST /api/compute/ssh-keysList keys / add a key. Body: { name, publicKey }
DELETE /api/compute/ssh-keys/:idRemove a key
GET | POST | DELETE /api/compute/vms/:id/ssh-keys/:keyIdList / attach / detach keys on a VM
GET | POST /api/compute/security-groupsList / create groups. Body: { name, description?, rules? }
GET | PATCH | DELETE /api/compute/security-groups/:idGet / update / delete a group
GET | POST /api/compute/security-groups/:id/rulesList / add rules. Body: { direction, protocol, portRange?, source, description? }
PATCH | DELETE /api/compute/security-groups/:sgId/rules/:ruleIdUpdate / remove a rule
GET | POST | DELETE /api/compute/vms/:id/security-groups/:sgIdList / attach / detach groups on a VM

Snapshots and backups

EndpointDescription
GET | POST /api/compute/vms/:id/snapshotsList / create snapshots. Body: { name }
POST /api/compute/vms/:id/snapshots/:snapshotId/restoreRestore a snapshot
DELETE /api/compute/vms/:id/snapshots/:snapshotIdDelete a snapshot
GET | POST /api/compute/vms/:id/backupsList / create full backups
POST /api/compute/vms/:id/backups/:backupId/restoreRestore a backup
DELETE /api/compute/vms/:id/backups/:backupIdDelete a backup
GET | POST | DELETE /api/compute/vms/:id/backup-scheduleGet / set / clear the schedule. Body: { frequency, time, retention }

IPs and private networks

EndpointDescription
GET | POST /api/compute/vms/:id/ipsList / add extra public IPs
DELETE /api/compute/vms/:id/ips/:ipIdRemove an extra IP
GET | POST /api/compute/networksList / create private networks. Body: { name, region }
DELETE /api/compute/networks/:idDelete a private network
GET | POST /api/compute/vms/:id/networksList / attach networks. Body: { networkId }
DELETE /api/compute/vms/:id/networks/:networkIdDetach a network

Startup scripts

EndpointDescription
GET /api/compute/scriptsEdge library scripts plus your custom scripts
GET /api/compute/scripts/libraryEdge library scripts only
GET /api/compute/scripts/:idGet one script with its content and parameters
POST /api/compute/scriptsCreate a custom script. Body: { name, scriptContent, description?, category?, parameters? }
PUT | DELETE /api/compute/scripts/:idUpdate / delete a custom script (library scripts are read-only)
GET /api/compute/vms/:id/scriptsScript execution history for a VM

To run a script at VM creation, substitute its parameters into the content and pass the result as setupScript. The CLI and Agent API do this for you.

Discovery and account

EndpointDescription
GET /api/compute/regionsAvailable deployment regions
GET /api/compute/os-templatesAvailable operating systems
GET /api/compute/pricingPay-as-you-go rates and prepaid balance
GET /api/compute/usageCurrent resource usage against account limits
GET /api/compute/eventsRecent compute events across the account

Something unclear or out of date? Tell us, or read this page as Markdown.