You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All routes are under /api. Authenticated routes require Authorization: Bearer <token> (the JWT from setup/login); "agent token" routes take a per-device tk-… token in the same header. External automation uses scoped ncapi-* tokens on the public machine surface — full reference in MACHINE_API.md.
Setup & auth
Method
Route
Auth
Description
GET
/setup/status
no
{ isSetup }
POST
/setup
no
Create the master password, returns a token (rate-limited)
POST
/login
no
Authenticate with the master password, returns a 24h token (rate-limited)
POST
/change-password
yes
Change the master password (current_password, new_password ≥ 8 chars)
Ping a single device, returns latency and raw output
POST
/devices/:id/wake
yes
Send Wake-on-LAN magic packets
POST
/devices/:id/command
yes
Queue reboot, shutdown, hibernate (agent channel when online, else SSH via the assigned profile) or update (agent only — self-updates from the installer and restarts itself)
PUT
/devices/:id/move
yes
Move a device to a group position (group_id + index)
GET
/devices/actions
yes
In-flight power actions of the last 10 minutes (status, failure output)
Agent endpoints
Method
Route
Auth
Description
GET
/agent/install
no
Serves the agent installer shell script (sh install.sh <server_url> <agent_token>)
GET
/agent/version
no
Current agent version (used by the UI to flag outdated agents)
POST
/agent/stats
agent token
Accept a metrics push; upserts live snapshot + raw history, rate-limited per IP. Also accepts claim tokens and auto-registers the device on first contact
GET
/agent/pending-actions
agent token
Fetch queued actions (marks them acknowledged)
GET
/agent/config
agent token
Effective agent configuration (push interval, server URL)
GET
/agent/script
agent token
Latest agent script (used by the update action to self-update)
POST
/agent/action-result
agent token
Report an action result (started / done / failed + output)
Device tokens & claims
Method
Route
Auth
Description
POST
/devices/:id/agent/token
yes
Generate or rotate the device's agent token (returned once, stored as a hash)
POST
/devices/:id/agent/reinstall
yes
Reinstall the agent remotely over SSH using the device's profile (new token generated server-side)
POST
/devices/agents/update
yes
Queue update for every online device running an outdated agent; returns { queued, up_to_date, disabled }