The Server Stats API provides host availability status and detailed system metrics collected over SSH. Status is determined via TCP ping; metrics require an SSH connection and are collected for SSH hosts with password or key-based authentication. All endpoints require JWT authentication. Metrics collection is background-polled on a configurable interval; the API returns the most-recently-cached snapshot. Admin endpoints for global settings also require admin privileges.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Termix-SSH/Termix/llms.txt
Use this file to discover all available pages before exploring further.
Host status
Get all host statuses
GET /status
Returns the current online/offline status for all of the authenticated user’s hosts.
Status entry keyed by numeric host ID.
Error responses
Error responses
| Status | Meaning |
|---|---|
| 401 | Session expired. |
Example request
Example request
cURL
Example response (200)
Example response (200)
Get host status by ID
GET /status/:id
Host ID. Must be a positive integer.
"online" or "offline".ISO 8601 timestamp.
Error responses
Error responses
| Status | Meaning |
|---|---|
| 400 | Invalid host ID. |
| 401 | Session expired. |
| 404 | Status not yet available (polling may not have run yet). |
Metrics
Get host metrics
GET /metrics/:id
Returns the latest cached metrics snapshot for a host. Metrics include CPU, memory, disk, network, uptime, processes, system info, login history, open ports, and firewall rules.
Host ID.
Login history with
recentLogins, failedLogins, totalLogins, and uniqueIPs.Open port information with
source ("ss", "netstat", or "none") and a ports array.Firewall configuration with
type ("iptables", "nftables", or "none"), status, and a chains array.ISO 8601 timestamp of when this snapshot was collected.
Error responses
Error responses
| Status | Meaning |
|---|---|
| 400 | Invalid host ID. |
| 401 | Session expired. |
| 404 | No metrics snapshot available yet. Returns empty null-filled metric objects. |
Example request
Example request
cURL
Start metrics collection
POST /metrics/start/:id
Establishes an SSH connection for a host and starts background metrics polling. Call this when a user opens the server-stats view for a host.
Host ID.
connectionLogs and one of:
{"status": "success", ...}on immediate connection.{"requires_totp": true, "sessionId": "...", ...}when TOTP is needed.
Error responses
Error responses
| Status | Meaning |
|---|---|
| 400 | Invalid host ID. |
| 401 | Session expired. |
| 404 | Host not found. |
| 500 | SSH connection failed. |
Stop metrics collection
POST /metrics/stop/:id
Stops background metrics polling for a host and terminates its SSH connection.
Host ID.
Verify metrics TOTP
POST /metrics/connect-totp
Completes a pending metrics SSH connection by submitting a TOTP code.
Session ID from the
POST /metrics/start/:id response.One-time code.
Register metrics viewer
POST /metrics/register-viewer
Registers the client as an active viewer for a host’s metrics, triggering full metrics collection if not already running.
Host ID.
A client-generated viewer session ID used for heartbeat tracking.
Unregister metrics viewer
POST /metrics/unregister-viewer
Removes the client viewer registration. When no viewers remain for a host, active metrics polling is suspended.
Host ID.
Viewer session ID to unregister.
Metrics heartbeat
POST /metrics/heartbeat
Updates the last-active timestamp for a viewer session. Send this every 60 seconds or less to prevent the server from automatically expiring the viewer session after 2 minutes of inactivity.
Viewer session ID.
true if the heartbeat was accepted.false if the session was not recognized (re-register).Polling control
Refresh polling
POST /refresh
Clears all SSH connections from the pool and restarts host polling for the user.
Example request
Example request
cURL
Clear all SSH connections
POST /clear-connections
Clears all cached SSH connections from the connection pool without restarting polling timers.
Notify host updated
POST /host-updated
Notifies the stats service that a host’s configuration has changed. This clears the cached SSH connection for the host and restarts its polling.
Host ID.
Error responses
Error responses
| Status | Meaning |
|---|---|
| 400 | Invalid hostId. |
| 401 | Session expired. |
| 404 | Host not found. |
| 500 | Failed to restart polling. |
Notify host deleted
POST /host-deleted
Stops all polling for a deleted host and removes its status/metrics from memory.
Host ID.
Global settings
Get global settings
GET /global-settings
Requires admin privileges.
Status check interval in seconds.
Metrics collection interval in seconds.
Update global settings
POST /global-settings
Requires admin privileges.
New status check interval in seconds. Must be between 10 and 3600.
New metrics collection interval in seconds. Must be between 10 and 3600.
Example request
Example request
cURL