Skip to content

API

Everything the dashboard does goes through this API, under https://<your-hub>/api/v1.

Send a token in the Authorization header:

Terminal window
curl -H "Authorization: Bearer $TOKEN" https://hub.example.com/api/v1/projects

For scripts, create a long-lived token in Settings → Tokens (admin only), and choose what it may do: Read only, Operate or Full access. Over the API, POST /settings/tokens takes {"name", "scope"} where scope is read, operate or admin (left out means admin). Revoke it in the same place when it is no longer needed.

Tokens from Settings → Tokens don’t ask for a two-factor code; the security page explains what that means.

Roles decide what a token’s user can do: viewer can read, operator can also deploy and change projects, admin can also manage users, tokens and settings, and open a node’s terminal.

Request Does
GET /projects List projects (paginated: ?page=1&limit=20). Env var values are masked.
GET /projects/:id One project.
POST /projects Create a project: {"name", "node_id", "image", "domain", "route_path", "ports", "env_vars", "volumes", "repository"}. Deploys it if an image is given; otherwise it waits on that node. repository (owner/repo) links GitHub deploys to it.
PUT /projects/:id Change a project. Send only the fields to change. env_vars values of ******** keep the stored value; "ports": [] switches to automatic ports; a different node_id moves the app; route_path (e.g. "/api/", or "" for the whole domain) serves it under a path of its domain.
POST /projects/:id/redeploy Restart the app with its current image and settings.
GET /projects/:id/rollback What a rollback would put back: {"current_image", "previous": {"image", "deployed_at", "commit", "commit_msg"} | null}.
GET /projects/:id/snapshots The app’s plugin snapshots: {"enabled", "keep", "max_mb", "plugins": [{"plugin_id", "snapshots", "interval_minutes", "last_snapshot_at", "items": [...]}]}.
POST /projects/:id/snapshots Operator: take a snapshot now.
POST /projects/:id/snapshots/:snapshot/restore Operator: put that snapshot back and redeploy.
GET /projects/:id/snapshots/:snapshot/download Operator: download the snapshot.
DELETE /projects/:id/snapshots/:snapshot Operator: delete one snapshot; DELETE /projects/:id/snapshots deletes them all.
POST /projects/:id/rollback Operator: redeploy the previous image. Returns 202 with a job_id; 409 if a deploy is running or there is no earlier version.
GET /projects/:id/placement The nodes the app could move to, best first, with score, uptime_7d, outages_24h, free memory and disk, headroom, master and recommended. See how the target node is chosen.
DELETE /projects/:id Delete a project and remove its container from the node.
GET /projects/:id/health Run a health check now.

Example — set env vars, keeping DB_PASSWORD as it is:

Terminal window
curl -X PUT https://hub.example.com/api/v1/projects/$ID \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"env_vars":[{"key":"DB_PASSWORD","value":"********"},{"key":"DEBUG","value":"false"}]}'
Request Does
POST /deploy Deploy from GitHub Actions (OIDC, no API token) — see Deploy from GitHub.
GET /deploy/history Recent GitHub deploys.
GET/POST/DELETE /deploy/allowed Repos allowed to deploy.
GET/POST/DELETE /deploy/tokens Registry tokens for pulling private images (stored encrypted, shown masked).
Request Does
GET /nodes, GET /nodes/:id Nodes and their health, including the containers each agent reports.
DELETE /nodes/:id Admin: remove a node (WireGuard access, keys, history). Refused with 409 while apps run on it.
GET /nodes/uptime Every node’s uptime and latest outage: see Node availability and load.
GET /nodes/:id/details One node with its uptime and latest outages, each with a likely cause.
GET /nodes/:id/samples?hours=24 The node’s CPU, memory, load and ping readings for its graphs, oldest first.
GET /nodes/:id/connection Last heartbeat, WireGuard handshake, ping and agent version.
GET /nodes/:id/terminal Admin: a WebSocket to a shell on the node, which is what the dashboard’s Terminal button uses. The token goes in the query (?token=), because a browser can’t set headers on a WebSocket.
PUT /nodes/:id/maintenance {"enabled": true|false}: start or end maintenance. Returns which apps are moving and which stay.
POST /nodes/:id/containers/:name/logs?lines=N Fetch a container’s logs; returns a job_id to follow with GET /jobs/:id/logs. Add &follow=1 to keep following for up to 10 minutes, and read the output as it arrives from GET /jobs/:id/stream (a WebSocket that sends snapshot, chunk and done messages). Refused with 409 when the node’s agent can’t follow logs (older agents).
POST /nodes/:id/containers/:name/restart Restart a container; returns a job_id.
GET /jobs, GET /jobs/:id/logs Jobs sent to nodes and their output. Environment values are masked.
GET /migrations Failovers and moves.
POST /agents/deploy Update the agent on all online nodes.
POST /nginx/update Rebuild app routes and certificates now.

Agents call these over the WireGuard network; from anywhere else they answer 403. They take no token. The Hub knows which node is calling from the private address the request came from (WireGuard lets a node send only from its own), and it ignores any node ID in the URL or query: agents send self where an ID would go.

Request Does
POST /nodes A node announces itself when its agent starts.
POST /nodes/self/heartbeat The heartbeat, every 30 seconds.
POST /nodes/self/maintenance A node asks to start or end maintenance for itself.
POST /jobs/claim A node asks for its next waiting job.
POST /jobs/:id/complete A node reports how a job ended. Only the node the job belongs to can.

See Status page.

Request Does
GET /status/apps No login. Each public app’s state and uptime; 404 until an admin makes the page public.
GET /status/apps/internal Signed in: the same, with every app.
GET/PUT /settings/status-page Admin: read or set {"public": true|false}.

Admin only; see Notifications.

Request Does
GET /notifications/types Channel types (Discord, Slack, Telegram, ntfy, email, webhook) and events.
GET/POST /notifications, PUT/DELETE /notifications/:id Channels; secrets are masked.
POST /notifications/:id/test Send a test message now.
Request Does
GET /system/version Running and latest version; ?refresh=1 checks GitHub now.
POST /system/update Admin: upgrade to the latest release.
GET /health (no /api/v1) Is the Hub up.
POST /auth/login {"username","password"} → {"token","user"} (dashboard login). If the user has two-factor on, → {"mfa_required":true,"mfa_token"} instead. Too many failures from an address or for an account → 429 with Retry-After.
POST /auth/2fa/login {"mfa_token","code"} → {"token","user"}. The code is a 6-digit app code or a recovery code; mfa_token lasts 5 minutes and is not a session.
POST /auth/2fa/setup Start setting up two-factor → {"secret","uri"} (the otpauth:// URI for a QR code).
POST /auth/2fa/enable {"code"} confirms the app and turns it on → {"recovery_codes"}, shown once.
POST /auth/2fa/disable {"password","code"} turns it off.
POST /auth/cli/start {"machine"} → {"code","poll_secret","expires_in","path"}: a login request for asdl-hub login (no sign-in needed; limited per address).
POST /auth/cli/poll {"code","poll_secret"} → 202 while waiting, 200 {"token","user"} once approved (once only), 410 if turned down or expired.
GET /auth/cli/request?code= Signed in: who asked and from where.
POST /auth/cli/approve, POST /auth/cli/deny Signed in: {"code"} answers the request. Approving gives admins a permanent token and others a day-long session.
DELETE /settings/users/:id/2fa Admin: turn two-factor off for a user who lost their device.