HTTP API
Every route the control plane serves, generated from openapi.yaml — the
route list of record. A test fails when the code serves a route the document does not describe, and
every host also serves the document itself at /api/openapi.yaml.
Call a route with a bearer token, or run it through the CLI: every route is a pstack api command.
curl -H "Authorization: Bearer $PSTACK_TOKEN" https://api.<domain>/api/deploymentspstack api deployments list111 routes in 20 groups.
deployments
Section titled “deployments”Submit, deploy, tear down, sleep, share and inspect a preview stack.
GET /api/deployments
Section titled “GET /api/deployments”Every deployment, with its busy/running state.
pstack api deployments list
DELETE /api/deployments/{id}
Section titled “DELETE /api/deployments/{id}”Forget a deployment. Refused while its containers exist.
pstack api deployments delete --id
GET /api/deployments/{id}
Section titled “GET /api/deployments/{id}”One deployment’s meta and spec summary.
pstack api deployments get --id
PUT /api/deployments/{id}
Section titled “PUT /api/deployments/{id}”Submit or replace a deployment. The spec is parsed before it is stored.
pstack api deployments put --id
POST /api/deployments/{id}/cancel
Section titled “POST /api/deployments/{id}/cancel”Stop everything this stack has outstanding — running and queued.
pstack api deployments cancel --id
POST /api/deployments/{id}/containers/{name}/{action}
Section titled “POST /api/deployments/{id}/containers/{name}/{action}”Start, stop or restart one container.
pstack api deployments containers act --action (start | stop | restart) --id --name
POST /api/deployments/{id}/down
Section titled “POST /api/deployments/{id}/down”Tear down. Preempts whatever the stack is doing.
pstack api deployments down --force? --forget? --id --verify?
GET /api/deployments/{id}/logs
Section titled “GET /api/deployments/{id}/logs”A slice of container logs, redacted.
pstack api deployments logs get --id --service? --tail?
GET /api/deployments/{id}/readiness
Section titled “GET /api/deployments/{id}/readiness”The readiness verdict, optionally waiting for one.
pstack api deployments readiness get --id --refresh? (1) --timeout? --wait?
GET /api/deployments/{id}/runtime
Section titled “GET /api/deployments/{id}/runtime”Containers, routes, findings, the host’s ACME challenge mode, and declaredServices: the services the compose logs to Loki, read from the file. Not on a share link.
pstack api deployments runtime get --id
POST /api/deployments/{id}/share
Section titled “POST /api/deployments/{id}/share”Mint a read-only link to one deployment.
pstack api deployments share create --id --ttl? --views? (details | logs)
POST /api/deployments/{id}/sleep
Section titled “POST /api/deployments/{id}/sleep”Take the project down, keeping every volume and axis.
pstack api deployments sleep --id
GET /api/deployments/{id}/source
Section titled “GET /api/deployments/{id}/source”The stored spec and compose file, as submitted.
pstack api deployments source get --id
GET /api/deployments/{id}/subdomains
Section titled “GET /api/deployments/{id}/subdomains”Each service with a generated host: { service, host, subdomains, from }, subdomains one, any or null, from spec, host or null. Viewer.
pstack api deployments subdomains ls --id
PUT /api/deployments/{id}/subdomains
Section titled “PUT /api/deployments/{id}/subdomains”Serve *.<host> for one service with a generated host, stored on this host (a CI redeploy keeps it). Applies on the next deploy. A service the spec sets is 409. Developer.
pstack api deployments subdomains set --depth (one | any | off) --id --service
POST /api/deployments/{id}/up
Section titled “POST /api/deployments/{id}/up”Deploy. 202 with a job — queued when the stack is busy.
pstack api deployments up --id
POST /api/deployments/{id}/verify
Section titled “POST /api/deployments/{id}/verify”Run every assert_gone and report what survived.
pstack api deployments verify --id
POST /api/deployments/{id}/wake
Section titled “POST /api/deployments/{id}/wake”Bring a sleeping deployment back.
pstack api deployments wake --id
What the host is doing, or just did. In memory, newest 50.
GET /api/jobs
Section titled “GET /api/jobs”The last 50 jobs, newest first. In memory — a restart loses them.
pstack api jobs list
GET /api/jobs/{jobId}
Section titled “GET /api/jobs/{jobId}”One job — state, transcript and outcome.
pstack api jobs get --job-id
POST /api/jobs/{jobId}/cancel
Section titled “POST /api/jobs/{jobId}/cancel”Stop one running job. Partial state is left as it is.
pstack api jobs cancel --job-id
Named specs, stored on the host and referenced by a deployment.
GET /api/specs
Section titled “GET /api/specs”Every named spec.
pstack api specs list
DELETE /api/specs/{name}
Section titled “DELETE /api/specs/{name}”pstack api specs delete --name
GET /api/specs/{name}
Section titled “GET /api/specs/{name}”pstack api specs get --name
PUT /api/specs/{name}
Section titled “PUT /api/specs/{name}”pstack api specs put --compose? --description? --name --spec
routing
Section titled “routing”Traefik’s dynamic-config files, and what it is actually serving.
GET /api/routing
Section titled “GET /api/routing”Traefik’s dynamic-config files.
pstack api routing list
DELETE /api/routing/{file}
Section titled “DELETE /api/routing/{file}”pstack api routing delete --file
GET /api/routing/{file}
Section titled “GET /api/routing/{file}”pstack api routing get --file
PUT /api/routing/{file}
Section titled “PUT /api/routing/{file}”pstack api routing put --content --file
GET /api/routing/live
Section titled “GET /api/routing/live”Every router Traefik currently knows about.
pstack api routing live
custom-routes
Section titled “custom-routes”Stable aliases for a stack: route checkout makes web-<stack>.<domain> also answer on web-checkout.<domain>.
GET /api/custom-routes
Section titled “GET /api/custom-routes”Every route: name, deployment, stack, the alias hosts it serves now, and blocked, each { host, by: { kind, name } } that a deployment (kind deployment) or an earlier route (kind route) serves instead. subdomains is one, any or null. deployment and stack are null when unassigned. Viewer.
pstack api custom-routes list
POST /api/custom-routes
Section titled “POST /api/custom-routes”Create a route, unassigned or assigned to a deployment. Never moves one: an existing name is 409, and force is accepted and ignored. Developer.
pstack api custom-routes create --deployment? --force? --name
DELETE /api/custom-routes/{name}
Section titled “DELETE /api/custom-routes/{name}”Delete a route; it stops serving at once. Developer.
pstack api custom-routes delete --name
DELETE /api/custom-routes/{name}/assignment
Section titled “DELETE /api/custom-routes/{name}/assignment”Unassign a route. It is kept, serving nothing. Developer.
pstack api custom-routes unassign --name
PUT /api/custom-routes/{name}/assignment
Section titled “PUT /api/custom-routes/{name}/assignment”Point a route at a deployment. Held by another one is 409 with assignedTo, unless force, which moves it in one step. A host something else serves is 409. No redeploy. Developer.
pstack api custom-routes assign --deployment --force? --name
PUT /api/custom-routes/{name}/subdomains
Section titled “PUT /api/custom-routes/{name}/subdomains”Also serve *.<host> for each host the route mirrors. A host something else serves is 409. No redeploy. Developer.
pstack api custom-routes subdomains --depth (one | any | off) --name
The host’s certificate mode, and the bring-your-own wildcard (dns-persist-01).
GET /api/domains
Section titled “GET /api/domains”The hostnames this host answers on: the primary init rendered, plus any added here. Maintainer.
pstack api tls domains
PUT /api/domains
Section titled “PUT /api/domains”Replace the additional domains. Each gets control./api. routers and a wake catch-all in Traefik’s watched directory — no re-init, no restart, live in about two seconds. The primary is refused (it already has routers on the container’s labels). Point a deployment at a domain with PREVIEW_DOMAIN in its vars. Maintainer.
pstack api tls domains-set --domains
GET /api/tls
Section titled “GET /api/tls”The host’s certificate mode, derived from its artifacts: dns-persist-01 when a wildcard is stored, else what Traefik’s own flags say. Includes the stored certificate’s public facts — never the key. Maintainer.
pstack api tls status
POST /api/tls/redeploy
Section titled “POST /api/tls/redeploy”Redeploy every awake stack so its router labels regenerate for the current mode — the migration loop from the TLS playbook, server-side. Asleep stacks are skipped (their labels regenerate on wake, and a redeploy would BE a wake). Each redeploy queues like any job. Maintainer.
pstack api tls redeploy
DELETE /api/tls/wildcard
Section titled “DELETE /api/tls/wildcard”Remove the stored wildcard — back to Traefik-native resolution. Stacks deployed under it then have no certificate until redeployed. Admin.
pstack api tls wildcard-remove
PUT /api/tls/wildcard
Section titled “PUT /api/tls/wildcard”Store a wildcard certificate pair and point Traefik at it — enters dns-persist-01 with no init and no restart. The pair is validated (match, dates, covers *.redeploy). Admin, for blast radius: it changes what every hostname on this host presents.
pstack api tls wildcard-set --cert --key
logging
Section titled “logging”Loki’s settings: chunks, retention, storage.
GET /api/logging
Section titled “GET /api/logging”Loki’s settings as saved, and the limits pstack enforces. enabled is null when docker did not answer. Never the S3 secret: secretSet only. Maintainer.
pstack api logging get
PUT /api/logging
Section titled “PUT /api/logging”Retention and chunks, every field. 202 carries the loki-apply job, which restarts Loki. An unchanged body on an idle host is 200 {changed: false}. 409 when Loki is not on this host. Maintainer.
pstack api logging set
PUT /api/logging/storage
Section titled “PUT /api/logging/storage”Filesystem, or S3 from a future cutover date. One-way: once S3 is saved, only the keys change. The keys are probed with a PUT and a DELETE first. Admin.
pstack api logging storage-set --access-key-id? --bucket? --cutover? --endpoint? --path-style? --region? --secret-access-key? --type (filesystem | s3)
registries
Section titled “registries”Private-registry logins, used when a deploy pulls.
GET /api/registries
Section titled “GET /api/registries”Private-registry logins. Hostnames only, never a credential.
pstack api registries list
DELETE /api/registries/{host}
Section titled “DELETE /api/registries/{host}”pstack api registries delete --host
PUT /api/registries/{host}
Section titled “PUT /api/registries/{host}”pstack api registries put --host --password --username
notifiers
Section titled “notifiers”Webhook and chat notifiers, their deliveries, and redelivery.
GET /api/notifiers
Section titled “GET /api/notifiers”pstack api notifiers list
POST /api/notifiers
Section titled “POST /api/notifiers”pstack api notifiers create
DELETE /api/notifiers/{notifierId}
Section titled “DELETE /api/notifiers/{notifierId}”pstack api notifiers delete --notifier-id
GET /api/notifiers/{notifierId}
Section titled “GET /api/notifiers/{notifierId}”pstack api notifiers get --notifier-id
PATCH /api/notifiers/{notifierId}
Section titled “PATCH /api/notifiers/{notifierId}”pstack api notifiers update --notifier-id
GET /api/notifiers/{notifierId}/deliveries
Section titled “GET /api/notifiers/{notifierId}/deliveries”pstack api notifiers deliveries list --notifier-id
POST /api/notifiers/{notifierId}/deliveries/{deliveryId}/redeliver
Section titled “POST /api/notifiers/{notifierId}/deliveries/{deliveryId}/redeliver”Send the stored envelope again, byte for byte.
pstack api notifiers deliveries redeliver --delivery-id --notifier-id
POST /api/notifiers/{notifierId}/test
Section titled “POST /api/notifiers/{notifierId}/test”Send one delivery now, straight to this notifier. It carries test: true.
pstack api notifiers test --notifier-id
GET /api/notifiers/meta
Section titled “GET /api/notifiers/meta”Every event name a notifier may subscribe to, and each type’s config shape.
pstack api notifiers meta
host-vars
Section titled “host-vars”Host variables and secrets, shared by every deployment.
GET /api/host-vars
Section titled “GET /api/host-vars”Every host variable. A secret’s NAME, never its value.
pstack api host-vars list
DELETE /api/host-vars/{name}
Section titled “DELETE /api/host-vars/{name}”pstack api host-vars delete --name
PUT /api/host-vars/{name}
Section titled “PUT /api/host-vars/{name}”pstack api host-vars put --name --secret? --value
Accounts, roles and passwords.
GET /api/auth/me
Section titled “GET /api/auth/me”Who this credential is, and at what role.
pstack api users me
GET /api/users
Section titled “GET /api/users”pstack api users list
POST /api/users
Section titled “POST /api/users”Admin only. An absent role means the host’s default_role.
pstack api users create --email? --password --role? (viewer | developer | maintainer | admin) --username
DELETE /api/users/{userId}
Section titled “DELETE /api/users/{userId}”Admin only. Refused on the last user and the last admin.
pstack api users delete --user-id
PATCH /api/users/{userId}
Section titled “PATCH /api/users/{userId}”Admin only. Refused on demoting the last admin.
pstack api users set-role --role (viewer | developer | maintainer | admin) --user-id
PUT /api/users/{userId}/password
Section titled “PUT /api/users/{userId}/password”Your own at any role; anybody else’s is admin only. Revokes their sessions.
pstack api users password set --password --user-id
tokens
Section titled “tokens”Personal API tokens.
GET /api/tokens
Section titled “GET /api/tokens”Your personal API tokens. Hashes are never returned.
pstack api tokens list
POST /api/tokens
Section titled “POST /api/tokens”Mint one. The token itself appears in this response and nowhere else, ever.
pstack api tokens create --name? --ttl?
DELETE /api/tokens/{tokenId}
Section titled “DELETE /api/tokens/{tokenId}”pstack api tokens delete --token-id
settings
Section titled “settings”The host settings changeable at runtime, without a restart: the job cap, the default role, the node pressure thresholds and the image prune age.
GET /api/settings
Section titled “GET /api/settings”Every runtime setting, resolved, each saying which layer it came from.
pstack api settings list
PUT /api/settings/default_role
Section titled “PUT /api/settings/default_role”The role an account gets when nothing names one. Admin only.
pstack api settings set-default-role --value (viewer | developer | maintainer | admin)
PUT /api/settings/image_prune_after_h
Section titled “PUT /api/settings/image_prune_after_h”Hours an unused image is kept before the prune removes it. Admin only.
pstack api settings set-image-prune-after-h --value
PUT /api/settings/max_jobs
Section titled “PUT /api/settings/max_jobs”How many jobs run at once, host-wide. Maintainer. In force immediately: raising it dispatches what was waiting, lowering it cancels nothing.
pstack api settings set-max-jobs --value
PUT /api/settings/pressure_cpu_load
Section titled “PUT /api/settings/pressure_cpu_load”5-minute load per core that puts a node in pressure. Admin only.
pstack api settings set-pressure-cpu-load --value
PUT /api/settings/pressure_disk_pct
Section titled “PUT /api/settings/pressure_disk_pct”Disk used % that puts a node in pressure. Admin only.
pstack api settings set-pressure-disk-pct --value
PUT /api/settings/pressure_mem_pct
Section titled “PUT /api/settings/pressure_mem_pct”Available memory % at or below which a node is in pressure. Admin only.
pstack api settings set-pressure-mem-pct --value
PUT /api/settings/pressure_sleep_idle_min
Section titled “PUT /api/settings/pressure_sleep_idle_min”Minutes a stack sits idle before pressure may sleep it. Admin only.
pstack api settings set-pressure-sleep-idle-min --value
Single sign-on providers.
DELETE /api/sso/config
Section titled “DELETE /api/sso/config”Forget the only provider. Accounts it created stay.
pstack api sso config delete
GET /api/sso/config
Section titled “GET /api/sso/config”Every provider, the callback URL to paste, and the presets. Never a client secret.
pstack api sso config get
PUT /api/sso/config
Section titled “PUT /api/sso/config”Create or replace one provider. Admin only.
pstack api sso config put
DELETE /api/sso/config/{key}
Section titled “DELETE /api/sso/config/{key}”pstack api sso provider delete --key
The swarm, and what a new worker runs to join it.
GET /api/signals
Section titled “GET /api/signals”What the swarm looks like now — every node with its task count, and every task docker would not place.
pstack api swarm signals
GET /api/swarm
Section titled “GET /api/swarm”The swarm’s nodes and the manager address. Never the join token.
pstack api swarm get
GET /api/swarm/join
Section titled “GET /api/swarm/join”What a new worker runs. THE OUTPUT IS A SECRET — every shape embeds the join token.
pstack api swarm join --distro? --format? (token | command | script | cloud-config)
DELETE /api/swarm/nodes/{id}
Section titled “DELETE /api/swarm/nodes/{id}”Forget a node whose machine is gone. Refused unless docker reports it down and drained.
pstack api swarm node-remove --id
POST /api/swarm/nodes/{id}/drain
Section titled “POST /api/swarm/nodes/{id}/drain”Take a node out of the running — swarm stops placing work on it and moves what is there. Refused (409) for the manager the API runs on; use POST /api/swarm/previews/workers.
pstack api swarm node-drain --id
POST /api/swarm/nodes/{id}/undrain
Section titled “POST /api/swarm/nodes/{id}/undrain”Put a drained node back into the running.
pstack api swarm node-undrain --id
POST /api/swarm/previews/{where}
Section titled “POST /api/swarm/previews/{where}”Where previews run. workers labels this manager pstack.previews=off, which every preview’s placement excludes; any labels it on.
pstack api swarm previews --where (workers | any)
config
Section titled “config”The whole portable configuration: export it, apply one.
GET /api/config
Section titled “GET /api/config”THE WHOLE PORTABLE CONFIGURATION IN PLAINTEXT: password hashes, token hashes, host secrets. Root token only, and it emits an event.
pstack api config export
POST /api/config
Section titled “POST /api/config”Apply such a document, create-or-skip. It can add but never repoint.
pstack api config import
POST /api/config/sealed
Section titled “POST /api/config/sealed”Apply a sealed export, unsealed with a passphrase. Admin only.
pstack api config import-sealed
forward
Section titled “forward”Where this host forwards deploys and unserved visitors, while it is being retired.
DELETE /api/forward
Section titled “DELETE /api/forward”Stop forwarding. Applies to the next request. Admin.
pstack api forward off
GET /api/forward
Section titled “GET /api/forward”Where this host forwards deploys and unserved visitors: { to, via, establishedAt, lastOkAt }, or null when off. Never the token. Maintainer.
pstack api forward get
PUT /api/forward
Section titled “PUT /api/forward”Forward to another pstack (B). Checked first: B’s GET /api/auth/me answers 200 for the token, which is not root and is developer or higher; to is not this host’s own API (unless via is given). Any failure is a 400 naming the check, and nothing is saved. Admin: it decides where every deploy runs.
pstack api forward set --to --token --via?
scaler
Section titled “scaler”The worker scaler: its settings, credential keys, Tofu presets and last report.
GET /api/scaler
Section titled “GET /api/scaler”The scaler settings, credential keys as { KEY: true } (never a value), the last report or null, and enabled (true/false, null when docker did not answer). Maintainer.
pstack api scaler get
PUT /api/scaler
Section titled “PUT /api/scaler”Replace the scaler settings. Absent fields take the defaults (min 0, max 3, cooldownMin 5, graceMin 15). A credential sent empty, omitted or as the mask keeps its value; null deletes it. 409 while the scaler owns workers and the change differs from the locked preset or shared vars, or deletes a credential. Admin.
pstack api scaler set
GET /api/scaler/config
Section titled “GET /api/scaler/config”Everything the scaler needs: settings, credential values and the preset’s files. Root only (PSTACK_TOKEN), never an admin session.
pstack api scaler config
GET /api/scaler/presets
Section titled “GET /api/scaler/presets”Every preset, built-in and custom: [{ name, builtin, preset, locked }]. Maintainer.
pstack api scaler presets
DELETE /api/scaler/presets/{name}
Section titled “DELETE /api/scaler/presets/{name}”Delete a custom preset. 409 on the locked preset. Admin.
pstack api scaler preset-delete --name
GET /api/scaler/presets/{name}
Section titled “GET /api/scaler/presets/{name}”One preset with its files: { name, builtin, files, preset, locked }. Maintainer.
pstack api scaler preset --name
PUT /api/scaler/presets/{name}
Section titled “PUT /api/scaler/presets/{name}”Store a custom preset: main.tf (more .tf files allowed) and an optional .terraform.lock.hcl. Built-ins are read-only. 409 on the locked preset unless the files are unchanged. Admin.
pstack api scaler preset-set --name
POST /api/scaler/report
Section titled “POST /api/scaler/report”The scaler’s status, and at most one scaler.* event to emit. Owned workers and the locked config are stored; the rest is kept in memory. Root only.
pstack api scaler report
The host itself — health, the control stack, terminal history, the probe.
GET /api/control
Section titled “GET /api/control”The control stack’s own containers. Read-only, never actionable.
pstack api host control
POST /api/control/restart
Section titled “POST /api/control/restart”Restart one control service by name (from control-runtime). pstack itself is always refused — it is the container answering this request. Restarting traefik severs in-flight connections for a few seconds, this response possibly included. Maintainer.
pstack api host control-restart --service
GET /api/control/runtime
Section titled “GET /api/control/runtime”The control stack as an operator debugs it: per container, restart count, OOM-killed flag and memory limit beside the usual state. A restarting Traefik silently loses in-flight certificate issuance — this page is where that stops being invisible. Maintainer.
pstack api host control-runtime
GET /api/health
Section titled “GET /api/health”Liveness, whether auth is enforced, whether any account exists, and the version. No token needed.
pstack api host health
GET /api/openapi.json
Section titled “GET /api/openapi.json”This document as JSON, key order preserved. No token needed.
pstack api host openapi-json
GET /api/openapi.yaml
Section titled “GET /api/openapi.yaml”This document, byte for byte. No token needed.
pstack api host openapi
GET /api/probe/{id}
Section titled “GET /api/probe/{id}”Is this preview serving? No token, no body — the answer is the status code and x-pstack-probe.
pstack api host probe --id --service?
GET /api/terminal-sessions
Section titled “GET /api/terminal-sessions”Who opened a container shell, when, and against what.
pstack api host terminal-sessions
What each node’s pstack-agent last reported, and the stacks using it. In memory; unknown values are null.
GET /api/stats
Section titled “GET /api/stats”Each node’s disk, memory and load from its agent, an hour of samples, and CPU and memory per stack. Unknown is null.
pstack api stats get