User API

Programmatic access to your account: balance, invoices, and your own VPS instances. Mint a key at /api-keys.

Overview

Base URL: https://<your-panel-host>. All paths are prefixed with /api/v1. Responses are JSON. Times are Unix epoch milliseconds unless noted.

Authentication

Send your key in one of two headers:

Authorization: Bearer vfc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-Api-Key: vfc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Scopes required for this API: user:read, user:write.

Account info

GET/api/v1/meuser:read

Returns the calling account.

{
  "id": 42,
  "email": "you@example.com",
  "name": "Jane",
  "credits_usd": 12.50,
  "credits_frozen": false,
  "role": "user"
}

Credit balance

GET/api/v1/credits/balanceuser:read
{ "credits_usd": 12.50, "frozen": false }

List servers

GET/api/v1/servicesuser:read

All non-terminal servers owned by the calling user. statusactive|paid|building|awaiting_setup|failed|suspended|expired.

[
  {
    "id": "svc_abc123",
    "hostname": "web-01",
    "status": "active",
    "pkg_id": 7,
    "pkg_name": "VPS-2",
    "expires_at": 1762000000000,
    "vf_id": 1234
  }
]

Get a server

GET/api/v1/services/:iduser:read

Returns the local service record. Includes the cached VirtFusion payload at vf_data.

Power action

POST/api/v1/services/:id/poweruser:write

Body:

{ "action": "start" }   // start | stop | restart | poweroff

Suspended or terminated servers reject this with 403.

List invoices

GET/api/v1/invoicesuser:read
[
  {
    "id": "inv_xyz",
    "status": "paid",
    "amount": 5.00,
    "currency": "USD",
    "type": "new",
    "target_id": "svc_abc123",
    "description": "VPS-2 (1 month)",
    "created_at": 1759400000000,
    "paid_at": 1759400500000,
    "due_at": null
  }
]

Get an invoice

GET/api/v1/invoices/:iduser:read

Returns the full invoice record. 403 if not yours.