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
| Method | Route | Description |
|---|---|---|
| POST | /api/auth/login | Login with username + password. Returns JWT access token. |
| GET | /api/health | Health check. Returns {"status": "ok"}. |
Services
| Method | Route | Description |
|---|---|---|
| GET | /api/services | List all systemd services with status. |
| POST | /api/services/{name}/{action} | Perform action on a service. Actions: start, stop, restart. |
Files
| Method | Route | Description |
|---|---|---|
| GET | /api/files/list | List directory contents. Query: ?path=/opt/pycon |
| GET | /api/files/read | Read file contents. Query: ?path=/path/to/file.py |
| POST | /api/files/save | Save file contents. Body: {"path": "...", "content": "..."} |
| DELETE | /api/files/delete | Delete a file or directory. Query: ?path=/path/to/file |
WebSockets
| Method | Route | Description |
|---|---|---|
| WS | /api/ws/terminal | Live 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. |