Dash HTTP API
This page summarizes stable HTTP contracts. Existing path, method, and field semantics are compatibility boundaries. New behavior is added through new endpoints or appended fields.
Basics
- API base path:
/api - Dash supports root-path deployment only. Do not configure a path prefix in
app.public_url. - JSON error wrapper:
{ "code": "<string>", "message": "<string>" }
Authentication Model
| Method | Use |
|---|---|
| Admin password | POST /api/auth/login |
refresh cookie + X-CSRF-Token | POST /api/auth/refresh, POST /api/auth/logout |
Authorization: Bearer <access_token> | Admin APIs and optionally authenticated reads |
X-Node-Secret | Node reporting, node identity reads, and deploy asset downloads |
upgrade_token query | Temporary deploy asset download grant issued only for legacy agent upgrades |
Optional Bearer endpoints treat missing, malformed, expired, revoked, or otherwise invalid Bearer tokens as anonymous requests.
Namespaces
| Prefix | Auth | Resources |
|---|---|---|
/api/auth | Admin password for login; refresh cookie + X-CSRF-Token for refresh and logout; /sessions* uses Bearer | POST /login, POST /refresh, POST /logout, session list and revoke |
/api/version | None | GET / |
/api/front | Optional Bearer | GET /brand, GET /metrics, GET /groups |
/api/metrics | Optional Bearer; history metrics are authorized by default | GET /online, GET /history |
/api/statistics | Optional Bearer | GET /access |
/api/statistics/traffic | Optional Bearer; PATCH /settings requires Bearer | GET /settings, PATCH /settings, GET /ifaces, GET /summary, GET /daily, GET /monthly |
/api/node | X-Node-Secret | POST /identity, POST /metrics, POST /static |
/api/admin/groups | Bearer | GET /, GET /map, POST /, PATCH /{id}, DELETE /{id} |
/api/admin/nodes | Bearer | GET /, GET /deploy, POST /, PUT /display-order, PATCH /traffic-p95, PATCH /{id}, POST /{id}/upgrade, GET /traffic/rebuild, POST /{id}/traffic/rebuild, DELETE /{id} |
/api/admin/alerts/rules | Bearer | GET /, POST /, PATCH /{id}, DELETE /{id} |
/api/admin/alerts/mounts | Bearer | GET /, PUT / |
/api/admin/alerts/settings | Bearer | GET /, PUT / |
/api/admin/alerts/channels | Bearer | GET /, POST /, GET /{id}, PUT /{id}, PUT /{id}/enabled, POST /{id}/test, DELETE /{id} |
/api/admin/alerts/channels/telegram/mtproto | Bearer | POST /code, POST /verify, POST /password, POST /ping |
/api/admin/system/settings | Bearer | GET /, PUT /, PATCH / |
/api/admin/system/themes | Bearer | GET /, POST /upload, POST /{id}/apply, DELETE /{id} |
Anonymous Reads
/api/front/brandallows anonymous reads./api/front/metricsand/api/front/groupsallow anonymous reads, filtered to guest-visible nodes.- Anonymous
/api/front/groupsomits groups with no guest-visible nodes. GET /api/front/metricsnode metadata includesnode.tagsas a string array when tags are configured for the node./api/metrics/onlineallows anonymous reads for guest-visible nodes./api/metrics/historyrequires Bearer by default. Anonymous reads are allowed only whenhistory_guest_access_mode=by_nodeand the node is guest-visible./api/statistics/accessallows anonymous reads./api/statistics/traffic/*anonymous reads follow traffic settings and node guest visibility.
Auth Sessions
POST /api/auth/loginacceptspasswordand requiredpersistence.persistenceallowssessionorpersistent; invalid values return400 invalid_persistence. A successful login returnsaccess_token,expires_at, andcsrf_token, and sets refresh/CSRF cookies.GET /api/auth/sessions/returns{ "sessions": [...] }for the bearer token user. Each item includesid,expires_at,session_only, andcurrent.DELETE /api/auth/sessions/current,DELETE /api/auth/sessions/, andDELETE /api/auth/sessions/{sid}return204on success.
Node Management
GET /api/admin/nodes/includestraffic_p95_enabled,traffic_cycle_mode,traffic_billing_start_day,traffic_billing_anchor_date,traffic_billing_timezone,traffic_direction_mode, tags, and version status.tagsis always a string array.version.versionis the last reported node version. Missing, invalid, or below the supported node version floor setversion.is_outdated=true.version.supports_auto_updateshows whether the current node version meets the Dash admin console automatic update delivery requirement. The minimum version is0.2.1.PATCH /api/admin/nodes/{id}accepts traffic settings, tags, secret, group IDs, and display fields. Omitted fields are unchanged.- Node billing cycle override fields are atomic. If any of
traffic_cycle_mode,traffic_billing_start_day,traffic_billing_anchor_date, ortraffic_billing_timezoneis submitted, the request must also includetraffic_cycle_modeand every field used by that mode, otherwise it returns400 invalid_traffic_cycle_settings. traffic_cycle_modeallowsdefault,calendar_month,whmcs_compatible, andclamp_to_month_end.defaultuses no billing fields;calendar_monthusestraffic_billing_timezone;clamp_to_month_endusestraffic_billing_start_dayandtraffic_billing_timezone;whmcs_compatibleusestraffic_billing_anchor_dateandtraffic_billing_timezone, withtraffic_billing_start_dayderived from the anchor date.traffic_direction_modeallowsdefault,out,both, andmax.defaultinherits the global direction mode; other values override that node.PATCH /api/admin/nodes/{id}returns400 invalid_secretfor an emptysecretand409 duplicate_secretwhen the submittedsecretalready belongs to another node.PATCH /api/admin/nodes/traffic-p95validates all node IDs before updating them in one transaction.GET /api/admin/nodes/traffic/rebuildreturns the latest process-local rebuild task state. This state is not durable across process restarts. Failed states expose stablecodeanderrorvalues.POST /api/admin/nodes/{id}/traffic/rebuildrebuilds the node's retained 5-minute traffic facts. Success returns202; missing nodes return404 not_found; any running task returns409 traffic_rebuild_running; unavailable tasks return503 traffic_rebuild_unavailable.POST /api/admin/nodes/{id}/upgradereturns204on success. Nodes that cannot receive automatic update delivery return409 node_upgrade_unsupported; unavailable bundled versions, platforms, or assets return409; failure to prepare the legacy temporary download grant returns503 node_upgrade_grant_error.
Agent Update
- Successful
POST /api/node/metricsresponses includeupdate. - When no upgrade task is pending,
updateisnull. - When an upgrade task is pending,
updateincludesid,version,url,sha256, andsize. urlmay include a short-livedupgrade_tokenso legacy agents can download the exact update asset without sendingX-Node-Secret. Clients must use the returned URL unchanged.- Upgrade tasks are volatile and clear when the agent reports the exact target version or a higher SemVer precedence. Different build metadata at the same SemVer precedence is treated as a distinct node binary and can still be delivered.
Front Metrics and History Metrics
GET /api/front/metrics node objects can include:
disk.smart: latest SMART runtime state.disk.temperature_devices[]: physical disk names with disk temperature history.thermal: latest thermal sensor runtime state.pressure: latest Linux PSI pressure runtime state.
SMART, thermal, and pressure runtime payloads are cached separately from the front node snapshot. They are reattached only when received_at matches the node snapshot.
POST /api/node/metrics accepts optional metrics.pressure. It may contain cpu, memory, and io, each with optional some and full numeric groups. Each group has avg10, avg60, avg300 percentages and cumulative total microseconds. Missing groups mean unavailable data, not zero pressure.
GET /api/metrics/history supports temperature metrics:
| Metric | Source | Device parameter |
|---|---|---|
cpu.temp_c | Maximum CPU thermal sensor temperature | Not required |
disk.temp_c | SMART physical disk temperature history | Required device |
For disk.temp_c, device can match physical disk name, ref, or path. Temperature history does not use a rollup prefix.
Disk temperature history is written only for backend-confirmed physical disks. Virtual disks and RAID devices are not persisted as disk.temp_c.
GET /api/metrics/history also supports PSI average metrics: pressure.cpu.some_avg10|avg60|avg300, pressure.memory.some_avg10|avg60|avg300, pressure.memory.full_avg10|avg60|avg300, pressure.io.some_avg10|avg60|avg300, and pressure.io.full_avg10|avg60|avg300.
Traffic Accounting
GET /api/statistics/traffic/settingsreturns guest access, usage mode, cycle settings, timezone, and direction mode.PATCH /api/statistics/traffic/settingsaccepts partial updates. Unknown values return400 invalid_fields.- Traffic queries use the node's effective traffic configuration. Nodes with
traffic_cycle_mode=defaultinherit the global cycle fields; nodes withtraffic_direction_mode=defaultinherit the global direction mode. - Daily traffic requires
usage_mode=billing. - P95 fields are non-null only when
p95_status=available.
Non-API HTTP Paths
| Path | Purpose |
|---|---|
/theme/active.css | Active theme CSS |
/theme/active.json | Active theme manifest; default theme can return 404 |
/theme/preview/{id}.png | Theme preview image |
/deploy/linux/install.sh | Linux node installer |
/deploy/macos/install.sh | macOS node installer |
/deploy/windows/install.ps1 | Windows node installer |
/deploy/* | Bundled node release assets; requires X-Node-Secret or a temporary upgrade_token |
/ | SPA |
Compatibility Rules
- Existing paths, methods, and field semantics stay stable.
- New behavior uses new endpoints or appended fields.
- Deprecations keep the old entrypoint before adding a replacement.