API Documentation

Welcome to our comprehensive API! Explore the endpoints below to seamlessly integrate with our services and enhance your applications.

GET /api/v1/vm

Parameters

  • vmid: this parameter represents the identifier (ID) for your VPS.

Request

curl -X GET "https://hammervm.com/api/v1/vm?vmid=1" -H "HVM-Key: api-key-123"

Response

{
  "vmId": 1,
  "host": "2a07:e05:3:f::1",
  "password": "KITTENS9.helpful",
  "operatingSystem": "Debian 12",
  "nextBillingDate": "2025-06-07 10:10:57.595",
  "isActive": true
}

Errors

  • 401 Unauthorized: The API Key isn't allowed to access this endpoint.
  • 403 Forbidden: You do not have permission to access the target VPS.
  • 500 Internal Server Error: An unexpected error occurred on the server.

GET /api/v1/vm-action

Parameters

  • vmid: this parameter represents the identifier (ID) for your VPS.
  • action: this parameter represents the action you wish to perform (reboot/start/stop/reinstall).

Request

curl -X GET "https://hammervm.com/api/v1/vm-action?vmid=1&action=stop" -H "HVM-Key: api-key-123"

Response

1

Errors

  • 400 Bad Request: You've entered an invalid action type.
  • 401 Unauthorized: The API Key isn't allowed to access this endpoint.
  • 403 Forbidden: You do not have permission to access the target VPS.
  • 500 Internal Server Error: An unexpected error occurred on the server.

GET /api/v1/vm-cancel

Parameters

  • vmid: this parameter represents the identifier (ID) for your VPS.

Request

curl -X GET "https://hammervm.com/api/v1/vm-cancel?vmid=1" -H "HVM-Key: api-key-123"

Response

{
  "vmId": 1,
  "cancelled": "true",
  "refundedBalance": "0.4375236872146119"
}

Errors

  • 401 Unauthorized: The API Key isn't allowed to access this endpoint.
  • 403 Forbidden: You do not have permission to access the target VPS.
  • 500 Internal Server Error: An unexpected error occurred on the server.

GET /api/v1/vm-order

Restricted
Notice: This endpoint is currently only available with prior permission. Please contact support to request access.

Parameters

  • pid: VPS package ID you wish to purchase.
  • os: Operating system identifier (integer for Sweden templates, string for Chicago) (naming conventions are a bit messy here).
  • region: Required only for Sweden packages (region code).

Request

curl -X GET "https://hammervm.com/api/v1/vm-order?pid=1&os=3&region=stockholm" -H "HVM-Key: api-key-123"

Response

{ "vmid": 944 }

Notes

  • Provisioning may be asynchronous depending on the backend (Chicago or Sweden).
  • Your account balance is deducted immediately upon successful request.
  • For Sweden, VM creation runs in a background task.

Errors

  • 401 Unauthorized: Invalid API key, insufficient balance, invalid parameters, or restricted package.
  • 500 Internal Server Error: An unexpected error occurred during provisioning.

GET /api/v1/invoice

Retrieve a single VPS invoice by UUID. The invoice must belong to the authenticated user.

Parameters

  • uuid: (required) The invoice UUID.

Headers

  • HVM-Key: Your API key.

Request

curl -X GET "https://hammervm.com/api/v1/invoice?uuid=invoice-uuid" -H "HVM-Key: api-key-123"

Response

{
 "id": 123,
 "uuid": "invoice-uuid",
 "amountDue": 9.99,
 "dueBy": "2026-01-10",
 "paid": true,
 "vmId": 456,
 "operatingSystem": "ubuntu-22.04",
 "date": "2026-01-01",
 "datePaid": "2026-01-01",
 "paymentMethod": "balance",
 "vpsPackage": { ... },
 "user": { ... }
}

Field Details

  • id: Internal invoice ID.
  • uuid: Public unique identifier.
  • amountDue: Invoice total amount.
  • dueBy: Payment due date.
  • paid: Whether the invoice is paid.
  • vmId: Associated VPS ID (if provisioned).
  • operatingSystem: Selected OS for the VPS.
  • date: Invoice creation date.
  • datePaid: Payment timestamp (null if unpaid).
  • paymentMethod: Method used (e.g. balance, crypto).
  • vpsPackage: VPS package details object.
  • user: Owner of the invoice.

Notes

  • Access is restricted to the invoice owner only.
  • If the invoice is unpaid, vmId may be 0 or not provisioned.
  • Dates are returned as strings (no enforced ISO format).

Errors

  • 401 Unauthorized: Missing or invalid API key.
  • 403 Forbidden: Invoice not found or not owned by user.

Document Publish Date: 16th of May, 2025

Close

Discount Save 35% using discount code FREEPALESTINE 🇵🇸 Order a VPS