Edge

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

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"
  }'
Field Required Description
name Yes 1–64 characters, letters, digits, and hyphens
region Yes Region id from GET /api/compute/regions
osTemplate Yes Template id from GET /api/compute/os-templates
vcpu / ram / disk Yes vCPUs (1–128), RAM in GB (1–512), disk in GB (10–10000)
sshKeyIds No SSH key ids to attach at first boot
securityGroupIds No Security group ids to attach
password No Root password (min 8 chars). Omit to have one generated and returned once.
setupScript No Bash script to run on first boot. See Startup Scripts for the library.

Returns 201:

{
  "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

Endpoint Description
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 & Console

Endpoint Description
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 & Security Groups

Endpoint Description
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 — { 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 & Backups

Endpoint Description
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 — { frequency, time, retention }

IPs & Private Networks

Endpoint Description
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

Endpoint Description
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 — { 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 & Account

Endpoint Description
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