API Reference

All endpoints require a Bearer token except /api/auth/login and /api/health.

All endpoints require a Bearer token except /api/auth/login and /api/health.

Auth

MethodRouteDescription
POST/api/auth/loginLogin with username + password. Returns JWT access token.
GET/api/healthHealth check. Returns {"status": "ok"}.

Services

MethodRouteDescription
GET/api/servicesList all systemd services with status.
POST/api/services/{name}/{action}Perform action on a service. Actions: start, stop, restart.

Files

MethodRouteDescription
GET/api/files/listList directory contents. Query: ?path=/opt/pycon
GET/api/files/readRead file contents. Query: ?path=/path/to/file.py
POST/api/files/saveSave file contents. Body: {"path": "...", "content": "..."}
DELETE/api/files/deleteDelete a file or directory. Query: ?path=/path/to/file

WebSockets

MethodRouteDescription
WS/api/ws/terminalLive PTY bash session. Pass ?token=JWT in query string.
WS/api/ws/logs/{service}Live journalctl -f stream for a service.
WS/api/ws/deploy/{name}Live output during project deployment.