Skip to content

Host Agent API Reference

The StackPilot agent listens over HTTPS on port 9091 and is normally reached only through the Hub. Direct use is intended for diagnostics and supported integrations on trusted networks.

Authentication

Every request requires X-Agent-Token. The Hub pins the agent certificate during enrollment; clients must not disable TLS verification just to call a self-signed agent certificate.

GET /api/status HTTP/1.1
Host: node-01:9091
X-Agent-Token: <agent-token>

Endpoints

Method Endpoint Purpose
GET /api/status, /api/stats Complete workload inventory, host telemetry, and runtime state.
GET /api/logs, /api/app-logs, /api/system-logs Container, application, and systemd logs.
GET /api/config, /api/secrets, /api/pod-containers Managed configuration, secret metadata, and pod files.
GET /api/storage-details, /api/volume-paths, /api/volume-file Storage data and allowed managed volume files.
GET /api/port-preflight, /api/remove-info Port/firewall preflight and removal impact preview.
GET /api/pull-status, /api/action-status Image-pull and action progress.
GET /api/app-backups Available application backups.
GET /api/critical-policies, /api/critical-settings Current monitoring policy and settings.
GET /api/agent/config, /api/source Agent configuration and supported source metadata.
POST /api/action, /api/action-background Workload lifecycle and asynchronous operations.
POST /api/app-backup, /api/app-rollback Creates or restores a supported app-level backup.
POST /api/config, /api/validate Saves or validates managed workload configuration.
POST /api/volume-paths, /api/volume-file Creates approved paths or writes an approved managed file.
POST /api/remove-storage, /api/setup Removes selected storage or runs supported host-side setup.
POST /api/agent/update, /api/agent/config, /api/agent/migrate-paths Updates, configures, or migrates agent-managed paths.
POST /api/critical-policies, /api/critical-settings, /api/critical-check Configures or runs critical-workload monitoring.
POST /api/terminal/start, /input, /resize, /close Terminal session lifecycle.
GET /api/terminal/stream Terminal output stream over SSE.
POST /api/notification-test Tests the configured notification channel.

Lifecycle Action Payload

POST /api/action accepts a workload name, target type, and action. Supported choices depend on workload type and runtime. Typical actions include start, stop, restart, remove, purge, up, pull, update, and rebuild.

{
  "target": "service",
  "name": "example.service",
  "action": "restart"
}

remove and purge are destructive. Docker agents can reject destructive actions when their safety policy does not allow them. Prefer Hub-routed requests so authorization, audit logging, confirmation, and backup handling remain in effect.