8080). User-facing endpoints for apps, machines, deployments, volumes, secrets, and databases are documented alongside their CLI commands in the Guides and CLI Reference.
This page covers the internal and administrative endpoints used by host agents and operators.
Public (no auth)
| Method | Path | Description |
|---|---|---|
GET | / | Service info ({"service":"zwrmd","version":"..."}) |
GET | /metrics | Prometheus metrics |
GET | /v1/health | Health check ({"status":"healthy"}) |
Internal (host agent auth)
These endpoints are used byzwrm-agent for registration and image distribution. Authenticated via SHA-256 hash of the license key.
| Method | Path | Description |
|---|---|---|
POST | /v1/internal/hosts/register | Register a host agent |
POST | /v1/internal/hosts/{host_id}/heartbeat | Host heartbeat |
POST | /v1/internal/hosts/{host_id}/deregister | Deregister a host agent |
GET | /v1/internal/images/{digest} | Download image by content-addressed digest |
HEAD | /v1/internal/images/{digest} | Check image existence |
GET | /v1/internal/images | List images (optional ?app_id=) |
Host management
| Method | Path | Description |
|---|---|---|
GET | /v1/hosts | List all hosts |
GET | /v1/hosts/{host_id} | Get host with capacity |
POST | /v1/hosts/{host_id}/drain | Initiate host drain |
GET | /v1/hosts/{host_id}/drain-status | Get drain progress |
POST | /v1/hosts/{host_id}/undrain | Cancel drain |
POST | /v1/hosts/{host_id}/activate | Return host from maintenance |
System
| Method | Path | Description |
|---|---|---|
GET | /v1/auth/whoami | Current user info |
GET | /v1/status | System status (scoped to user’s org) |
Authentication
Protected endpoints require one of:- Session token:
Authorization: Bearer <session_token> - API key:
Authorization: Bearer <api_key> - Localhost bypass: Requests from
127.0.0.1or::1bypass auth withhost-adminaccess
/v1/internal/) use the license key hash for authentication instead of session tokens.
Middleware
All requests pass through the middleware stack in order:| Middleware | Description |
|---|---|
| Logger | Logs METHOD PATH STATUS DURATION BYTES |
| Recovery | Catches panics, returns 500 JSON |
| CORS | Validates Origin against cors.allowed_origins |
| Metrics | Records Prometheus metrics |
| Auth | Validates Bearer token (protected routes only) |