Developer Resources

REST API & CLI

Manage instances, power cycles, reverse DNS records, and snapshot backups programmatically.

Base Endpoint: https://api.hostcraft.xyz/v1/
All API requests must include your Bearer API token generated inside your client dashboard security tab.

Authentication

Pass your authorization token as a standard HTTP header with every request:

Authorization: Bearer hc_live_xxxxxxxxxxxxxxxxxxxx

Core API Endpoints

GET /v1/instances

List All Instances

Returns status, assigned IP, node location, and current CPU/RAM utilization metrics.

POST /v1/instances

Deploy New Server

Deploys a new KVM slice or bare metal instance with chosen OS image and SSH keys in <60s.

POST /v1/instances/{id}/power

Power Controls

Triggers remote ACPI shutdown, instant reboot, or hard power cycle.

POST /v1/instances/{id}/snapshots

Snapshot Management

Creates live NVMe point-in-time snapshots or restores a previous disk state.

Example: Fetch Instances via cURL

# Request:

curl -X GET https://api.hostcraft.xyz/v1/instances \
  -H "Authorization: Bearer $HOSTCRAFT_TOKEN"

Official CLI Tool

You can also control infrastructure directly from your workstation using our lightweight Golang CLI:

# Install via NPM or Binary
npm install -g @hostcraft/cli

# Authenticate and list servers
hostcraft auth login
hostcraft instances list