Skip to main content

REST API

HyperSDK exposes 205+ REST API endpoints for full automation and integration.

Base URL

https://your-server:5080/api/v1/

All endpoints are prefixed with /api/v1/. Legacy paths (without prefix) are also supported for backward compatibility.

Authentication

# Login
curl -sk -X POST https://your-server:5080/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "secret"}'

# Use the returned token
curl -sk -H "Authorization: Bearer TOKEN" \
https://your-server:5080/api/v1/jobs

Core Endpoints

Jobs

MethodEndpointDescription
GET/jobsList all jobs
POST/jobsCreate a new export/migration job
GET/jobs/{id}Get job status
DELETE/jobs/{id}Cancel a job
GET/jobs/{id}/logsStream job logs

VMs

MethodEndpointDescription
GET/vms/listList VMs from connected provider
POST/vms/browseBrowse VM details
POST/vms/compareCompare source and target VMs
POST/vms/deployDeploy a converted VM

Providers

MethodEndpointDescription
GET/providersList configured providers
POST/providers/connectConnect to a cloud provider
GET/providers/capabilitiesDetect provider capabilities

System

MethodEndpointDescription
GET/healthHealth check
GET/system/healthDetailed system metrics
GET/system/alertsActive alerts
GET/metricsPrometheus-format metrics
GET/readinessMigration readiness checks

Upload & Download

MethodEndpointDescription
POST/upload/initInitialize chunked upload
POST/upload/chunkUpload a chunk (10 MB)
POST/upload/completeFinalize upload
GET/upload/status/{id}Check upload progress
GET/downloadDownload a VM disk image
GET/browse/filesBrowse server filesystem

Scheduling

MethodEndpointDescription
GET/schedulesList scheduled jobs
POST/schedulesCreate a schedule (cron format)
DELETE/schedules/{id}Remove a schedule

Carbon-Aware

MethodEndpointDescription
GET/carbon/intensityCurrent grid carbon intensity
GET/carbon/scheduleOptimal low-carbon time windows

WebSocket

wss://your-server:5080/ws

Real-time updates for job progress, system metrics, and alerts.

Rate Limiting

API requests are rate-limited per client IP. Default: 100 requests/minute. Authenticated users get higher limits.

Error Format

All errors return JSON:

{
"error": "descriptive error message",
"status": 400
}

Pagination

List endpoints support pagination via offset and limit query parameters:

curl -sk -H "Authorization: Bearer TOKEN" \
"https://your-server:5080/api/v1/jobs?offset=0&limit=20"

Parameters:

ParameterTypeDefaultDescription
offsetinteger0Number of records to skip
limitinteger50Maximum number of records to return (max 200)

Response format:

All paginated responses include a pagination object alongside the data:

{
"data": [ ... ],
"pagination": {
"offset": 0,
"limit": 20,
"total": 142,
"has_more": true
}
}

Use has_more to determine whether to fetch the next page. Increment offset by limit to page forward:

# Page 1
curl -sk -H "Authorization: Bearer TOKEN" \
"https://your-server:5080/api/v1/jobs?offset=0&limit=20"

# Page 2
curl -sk -H "Authorization: Bearer TOKEN" \
"https://your-server:5080/api/v1/jobs?offset=20&limit=20"

Filtering

Most list endpoints accept query parameters for filtering results. Filters are combined with AND logic.

Common Filters

ParameterApplies ToExample
statusJobs, VMs?status=running
providerJobs, VMs, Providers?provider=vsphere
typeJobs?type=export
osVMs?os=linux
created_afterJobs, Schedules?created_after=2025-01-01T00:00:00Z
created_beforeJobs, Schedules?created_before=2025-12-31T23:59:59Z
searchAll list endpoints?search=web-server
sortAll list endpoints?sort=created_at&order=desc

Example: Filter jobs by status and provider

curl -sk -H "Authorization: Bearer TOKEN" \
"https://your-server:5080/api/v1/jobs?status=completed&provider=vsphere&sort=created_at&order=desc&limit=10"

Example: Search VMs by name

curl -sk -H "Authorization: Bearer TOKEN" \
"https://your-server:5080/api/v1/vms/list?search=prod-db&os=linux"

Request and Response Examples

POST /api/v1/jobs -- Create an Export Job

Request:

curl -sk -X POST https://your-server:5080/api/v1/jobs \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "export",
"provider": "vsphere",
"vm_name": "web-server-01",
"format": "ova",
"options": {
"compress": true,
"include_snapshots": false,
"destination": "/var/lib/hypersdk/exports/"
}
}'

Response (201 Created):

{
"id": "job-a1b2c3d4",
"type": "export",
"status": "queued",
"provider": "vsphere",
"vm_name": "web-server-01",
"format": "ova",
"progress": 0,
"created_at": "2025-06-15T10:30:00Z",
"updated_at": "2025-06-15T10:30:00Z",
"estimated_duration": "12m",
"options": {
"compress": true,
"include_snapshots": false,
"destination": "/var/lib/hypersdk/exports/"
}
}

GET /api/v1/vms/list -- List Discovered VMs

Request:

curl -sk -H "Authorization: Bearer TOKEN" \
"https://your-server:5080/api/v1/vms/list?provider=vsphere&limit=5"

Response (200 OK):

{
"data": [
{
"name": "web-server-01",
"provider": "vsphere",
"os": "linux",
"os_version": "RHEL 9.3",
"cpu": 4,
"memory_mb": 8192,
"disks": [
{
"name": "disk-0",
"size_gb": 100,
"format": "vmdk",
"thin_provisioned": true
}
],
"nics": [
{
"name": "nic-0",
"type": "vmxnet3",
"network": "VM Network",
"mac": "00:50:56:ab:cd:ef"
}
],
"power_state": "poweredOn",
"tools_status": "running",
"last_seen": "2025-06-15T10:25:00Z"
},
{
"name": "db-server-01",
"provider": "vsphere",
"os": "linux",
"os_version": "Ubuntu 24.04",
"cpu": 8,
"memory_mb": 32768,
"disks": [
{
"name": "disk-0",
"size_gb": 50,
"format": "vmdk",
"thin_provisioned": false
},
{
"name": "disk-1",
"size_gb": 500,
"format": "vmdk",
"thin_provisioned": true
}
],
"nics": [
{
"name": "nic-0",
"type": "vmxnet3",
"network": "DB Network",
"mac": "00:50:56:ab:12:34"
}
],
"power_state": "poweredOn",
"tools_status": "running",
"last_seen": "2025-06-15T10:25:00Z"
}
],
"pagination": {
"offset": 0,
"limit": 5,
"total": 87,
"has_more": true
}
}

POST /api/v1/vms/deploy -- Deploy a Converted VM

Request:

curl -sk -X POST https://your-server:5080/api/v1/vms/deploy \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "web-server-01",
"disk_path": "/var/lib/libvirt/images/web-server-01.qcow2",
"cpu": 4,
"memory_mb": 8192,
"network": "default",
"autostart": true,
"target": "libvirt"
}'

Response (201 Created):

{
"name": "web-server-01",
"uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"status": "running",
"target": "libvirt",
"cpu": 4,
"memory_mb": 8192,
"disk_path": "/var/lib/libvirt/images/web-server-01.qcow2",
"network": "default",
"mac": "52:54:00:ab:cd:ef",
"autostart": true,
"created_at": "2025-06-15T10:45:00Z",
"vnc_port": 5901
}

Schedule a Demo to see the API in action.