Skip to content

API Reference

Pankha exposes a REST API for configuration and a WebSocket interface for real-time data. Base URL: http://<server-ip>:3143


MethodEndpointDescription
GET/healthBackend health check with service statistics
GET/api/overviewAggregate stats across all systems
GET/api/websocket/infoWebSocket connection info and stats
POST/api/emergency-stopSet all fans to 100% on all systems

MethodEndpointDescription
GET/api/systemsList all registered agents
POST/api/systemsAdd new system
GET/api/systems/limitGet agent limit info (current count, tier limit)
GET/api/systems/:idGet system details with sensors/fans
PUT/api/systems/:idUpdate system configuration
DELETE/api/systems/:idRemove system
GET/api/systems/:id/statusReal-time connection status
GET/api/systems/:id/diagnosticsGet hardware diagnostics from agent
MethodEndpointDescription
GET/api/systems/controller/statusFan profile controller status
PUT/api/systems/controller/intervalSet controller update interval
MethodEndpointDescription
GET/api/systems/:id/sensorsGet all sensors for system
PUT/api/systems/:id/sensors/:sensorId/labelSet custom sensor label
PUT/api/systems/:id/sensors/:sensorId/visibilityShow/hide sensor
GET/api/systems/:id/sensor-visibilityGet visibility settings
PUT/api/systems/:id/sensor-groups/:groupName/visibilityShow/hide sensor group
MethodEndpointDescription
GET/api/systems/:id/fansGet all fans for system
PUT/api/systems/:id/fans/:fanIdSet fan speed (0-100%)
PUT/api/systems/:id/fans/:fanId/labelSet custom fan label
MethodEndpointDescription
PUT/api/systems/:id/update-intervalSet agent polling interval (seconds)
PUT/api/systems/:id/fan-stepSet fan speed step % (smoothing)
PUT/api/systems/:id/hysteresisSet temperature hysteresis (°C)
PUT/api/systems/:id/emergency-tempSet emergency temperature threshold
PUT/api/systems/:id/failsafe-speedSet failsafe fan speed (0-100%)
PUT/api/systems/:id/enable-fan-controlEnable/disable fan control
PUT/api/systems/:id/log-levelSet agent log level
PUT/api/systems/:id/nameSet agent display name
POST/api/systems/:id/updateTrigger remote agent self-update
MethodEndpointDescription
GET/api/systems/settingsGet all backend settings
GET/api/systems/settings/:keyGet a specific setting by key
PUT/api/systems/settings/:keyUpdate a setting ({ "value": "..." })

Allowed setting keys: controller_update_interval, graph_history_hours, data_retention_days, accent_color, hover_tint_color

MethodEndpointDescription
PUT/api/systems/:id/profileAssign profile to system
POST/api/systems/:id/profilesCreate system-specific profile
GET/api/systems/:id/historyGet historical sensor/fan data
GET/api/systems/:id/chartsGet aggregated chart data

MethodEndpointDescription
GET/api/fan-profilesList all profiles
GET/api/fan-profiles/:idGet profile details
POST/api/fan-profilesCreate new profile
PUT/api/fan-profiles/:idUpdate profile
DELETE/api/fan-profiles/:idDelete profile
GET/api/fan-profiles/statsProfile statistics
POST/api/fan-profiles/assignAssign profile to fan
GET/api/fan-profiles/assignments/:systemIdGet fan assignments
POST/api/fan-profiles/calculate-speedCalculate speed for temp
GET/api/fan-profiles/exportExport profiles to JSON
POST/api/fan-profiles/importImport profiles from JSON
GET/api/fan-profiles/defaultsList available default profiles
POST/api/fan-profiles/load-defaultsLoad default profiles into database

MethodEndpointDescription
GET/api/fan-configurations/:systemIdGet fan configurations
POST/api/fan-configurations/sensorConfigure fan sensor mapping

MethodEndpointDescription
POST/api/discovery/scanScan network for agents
GET/api/discovery/hardwareGet discovered hardware
POST/api/discovery/test-fanTest fan control
GET/api/discovery/systems/:id/sensors/scanScan for new sensors
PUT/api/discovery/systems/:id/sensors/:sensorIdUpdate discovered sensor
POST/api/discovery/systems/:id/sensor-mappingMap sensors to labels

MethodEndpointDescription
POST/api/deploy/templatesGenerate a deployment token (expires in 24h)
GET/api/deploy/linuxServe dynamic install script (?token=<token>)
GET/api/deploy/hub/statusStatus of locally cached agent binaries
POST/api/deploy/hub/stageDownload a specific agent version to the hub
DELETE/api/deploy/hub/clearClear all locally cached agent binaries
GET/api/deploy/binaries/:archServe cached agent binary (x86_64 / aarch64)

MethodEndpointDescription
GET/api/config/deploymentGet deployment config (hub IP and port)

MethodEndpointDescription
GET/api/licenseGet current license info (tier, limits, expiration)
POST/api/licenseActivate license key
DELETE/api/licenseRemove license (revert to free tier)
GET/api/license/pricingGet tier pricing info
POST/api/license/syncForce sync with license server (check for renewals)

Endpoint: ws://<server-ip>:3143/websocket

EventDescription
fullStateComplete snapshot on connection
systemDeltaIncremental updates (bandwidth optimized)
agentRegisteredAgent connected
agentOfflineAgent disconnected
agentErrorAgent error occurred
agentConfigUpdatedConfig change (immediate broadcast)
{
"type": "systemDelta",
"data": {
"agentId": "linux-agent-1",
"timestamp": "2025-01-01T12:00:00Z",
"changes": ["sensors", "fans"],
"sensors": [{ "id": "temp1", "temperature": 45.2 }],
"fans": [{ "id": "fan1", "rpm": 1200, "speed": 40 }]
}
}

Terminal window
curl -X PUT http://localhost:3143/api/systems/1/fans/fan1 \
-H "Content-Type: application/json" \
-d '{"speed": 75}'
Terminal window
curl -X POST http://localhost:3143/api/fan-profiles \
-H "Content-Type: application/json" \
-d '{
"profile_name": "Silent",
"curve_points": [
{"temperature": 30, "fan_speed": 30},
{"temperature": 50, "fan_speed": 50},
{"temperature": 70, "fan_speed": 100}
]
}'
Terminal window
curl http://localhost:3143/health

{
"success": false,
"error": "Error message",
"message": "Detailed description"
}
CodeMeaning
200Success
201Created
400Bad request
403Forbidden (license limit / read-only mode)
404Not found
500Server error
503Service unavailable

  • Authentication: Not required in current version
  • Rate Limiting: None enforced; use WebSocket for real-time updates
  • URL Parameters: Replace :id, :fanId, etc. with actual values