Skip to content

API Reference

All endpoints except /api/v1/auth/login and /health require authentication via a session cookie (set automatically at login). API clients may alternatively use an Authorization: Bearer <token> header.

State-changing requests (POST, PUT, PATCH, DELETE) to authenticated endpoints also require an X-CSRF-Token header matching the csrf_token cookie value.


MethodPathDescription
POST/api/v1/auth/loginLog in, sets httpOnly session cookie and csrf_token cookie. Rate-limited: 5 attempts/60s per IP.
POST/api/v1/auth/logoutLog out, revokes session token and clears cookies

MethodPathDescription
GET/api/v1/usersList all users
POST/api/v1/usersCreate a new user
GET/api/v1/users/{id}Get user by ID
PUT/api/v1/users/{id}Update user
DELETE/api/v1/users/{id}Delete user

MethodPathDescription
GET/api/v1/nodesList all registered nodes (?device_type=edge or ?device_type=relay to filter)
POST/api/v1/nodesRegister a new node (set device_type to "edge" or "relay", returns reg token)
GET/api/v1/device-typesList all registered device drivers and their capabilities
GET/api/v1/nodes/{id}Get node by ID
PUT/api/v1/nodes/{id}Update node metadata
DELETE/api/v1/nodes/{id}Delete node
POST/api/v1/nodes/{id}/tokenRegenerate registration token
GET/api/v1/nodes/{id}/configGet cached config from connected node
POST/api/v1/nodes/{id}/commandSend a command to a connected node

MethodPathDescription
GET/api/v1/eventsList events (supports pagination)
POST/api/v1/events/{id}/ackAcknowledge an event
GET/api/v1/events/countGet unacknowledged event count

MethodPathDescription
GET/api/v1/settingsGet current settings
PUT/api/v1/settingsUpdate settings
GET/api/v1/settings/tlsGet TLS certificate info (subject, issuer, self-signed status)
POST/api/v1/settings/tls/uploadUpload new TLS certificate and key (PEM format, requires server restart)

MethodPathDescription
GET/api/v1/exportExport all data as JSON
POST/api/v1/importImport data from JSON

Note: Import is currently defined but not yet fully implemented.


MethodPathDescription
POST/api/v1/ai/generate-configAI flow management (action-based)
POST/api/v1/ai/analyzeAI-powered anomaly analysis
POST/api/v1/ai/queryNatural language query about nodes
GET/api/v1/ai/keysList stored AI provider keys
POST/api/v1/ai/keysStore an AI provider API key
DELETE/api/v1/ai/keysDelete an AI provider API key

Request body: { "prompt": "...", "provider": "openai|anthropic|gemini", "node_id": "optional", "existing_flows": [] }

The AI returns an action envelope in config:

{ "success": true, "config": { "action": "<type>", ... }, "raw_response": "..." }

Supported action types: create_flow, update_flow, delete_flow, add_output, remove_output, start_flow, stop_flow, restart_flow, info, multiple.

If node_id is provided and the node is online, real flow configs are fetched from the hub cache for context. The user’s stored model_preference is used when calling the AI provider.


Real-time updates for browser-based dashboards. Receives JSON messages containing aggregated node status, stats, and health data. Requires an authenticated session.

Device node connection endpoint (edge nodes and relay servers). Nodes must send an auth message as the first WebSocket frame containing either:

  • registration_token for first-time registration, or
  • node_id + node_secret for reconnection

Message types from nodes: stats, health, event, config_response, command_ack, pong.

Message types from manager: ping, command, register_ack, auth_ok, auth_error.

Edge commands (via POST /api/v1/nodes/{id}/command): get_config, update_config, create_flow, update_flow, delete_flow, start_flow, stop_flow, restart_flow, add_output, remove_output.

Relay commands (via POST /api/v1/nodes/{id}/command): get_config, disconnect_edge (requires edge_id), close_tunnel (requires tunnel_id), list_tunnels, list_edges, authorize_tunnel (requires tunnel_id, ingress_token, egress_token — pre-authorizes HMAC-SHA256 bind tokens for a tunnel), revoke_tunnel (requires tunnel_id — removes bind authorization).


MethodPathDescription
GET/healthHealth check (no authentication)