REST API
JSON over HTTPS. Base URL https://hostess2.lab.stratus5.net.
Every route under /v1 needs a bearer token. Mutations return
an operation id you poll for progress.
Authentication
Send the token in an Authorization: Bearer header. The
configured HOSTESS_API_KEY is the bootstrap key. Per-consumer
keys are minted with hostess apikey mint <name> and
revoked independently. Only the SHA-256 of each key is stored, and the raw value is shown once
at mint. A missing or unknown token gets 401.
Authorization: Bearer hk_live_...
Providers
/v1/providers
Native driver names plus the generic tofu driver.
Connections
A connection binds a driver to a sealed credential. Secrets are write-only and never returned.
/v1/connections
List connections. Filter with ?driver=hcloud.
/v1/connections
Create a connection. The secret is sealed server-side.
/v1/connections/{id}
Delete a connection.
/v1/connections/{id}/regions
Catalog regions. tofu connections return [] (free-text region).
/v1/connections/{id}/sizes
Catalog sizes. Narrow with ?region=.
/v1/connections/{id}/images
Catalog images.
POST /v1/connections
{
"name": "hetzner-prod",
"driver": "hcloud",
"secret": "",
"meta": {}
}
{ "id": "..." }
Nodes
/v1/nodes
Provision a node. name and connectionId required. Returns 202.
/v1/nodes
List nodes.
/v1/nodes/{id}
Get one node.
/v1/nodes/{id}/start
Power on. Native drivers only.
/v1/nodes/{id}/stop
Power off.
/v1/nodes/{id}/restart
Reboot.
/v1/nodes/{id}/run
Run ansible scripts on a node. Body takes scriptIds and optional extraVars.
/v1/nodes/{id}
Destroy the node. Returns an operation id.
POST /v1/nodes
{
"name": "web-1",
"connectionId": "",
"region": "nbg1",
"size": "cx22",
"image": "ubuntu-24.04",
"tags": ["edge"]
}
{
"nodeId": "...",
"operationId": "..."
}
Operations
Every mutation enqueues an operation. Each carries ordered steps with streamed output.
/v1/operations
List recent operations. Cap with ?limit=.
/v1/operations/{id}
Get one operation with its steps.
{
"id": "...",
"type": "create_node",
"status": "running",
"attempts": 1,
"steps": [
{ "seq": 0, "name": "build-provider", "status": "succeeded" },
{ "seq": 1, "name": "ensure-ssh-key", "status": "succeeded" },
{ "seq": 2, "name": "create-vm", "status": "running", "output": "..." }
]
}
Ansible scripts
/v1/ansible/scripts
List playbooks (metadata, no content).
/v1/ansible/scripts
Create a playbook. name and content required.
/v1/ansible/scripts/{id}
Get one playbook including its content.
/v1/ansible/scripts/{id}
Update content and variables. Bumps version, keeps history.
/v1/ansible/scripts/{id}
Delete a playbook. System playbooks are protected.