HTTP Endpoints¶
Base URL: http://<host>:7200
POST /rpc — JSON-RPC Gateway¶
All automation commands (except SSE streaming) go through this endpoint.
POST /rpc HTTP/1.1
Content-Type: application/json
{"jsonrpc":"2.0","method":"<method>","params":[...],"id":1}
| Response | Condition |
|---|---|
| HTTP 200 + JSON result | Success |
| HTTP 200 + JSON error object | JSON-RPC error |
| HTTP 204 | Method returned no value |
GET /events — Server-Sent Events¶
Real-time push stream for incoming messages, delivery receipts, join progress, and Privitty events.
Example event:
- Keepalive
: pingcomment every 15 seconds event: lagemitted if the client falls behind
Full event list: SSE Events
GET /health — Liveness Probe¶
Used by Docker HEALTHCHECK, Kubernetes probes, and load balancers.
POST /auth — Viewer Authentication¶
Binds a privitty-viewer session. Requires the device fingerprint (SHA-256 of MAC + machine-id).
Success (200):
Error (403):
Only one viewer session is active at a time.
GET /stream/:msg_id — Secure File Stream¶
Decrypts a .prv attachment and streams plaintext bytes. Requires a valid Bearer token from /auth.
| Status | Condition |
|---|---|
| 200 | File streamed (Content-Type detected by magic bytes) |
| 401 | Missing, expired, or invalid token |
| 404 | Message or file not found |
| 500 | Decryption failed |
The file is never written to disk in plaintext on the server.
CORS¶
CORS headers are disabled by default. Enable with the --cors daemon flag for web-based HMI frontends: