Stream decisions (SSE)
Server-Sent Events stream for real-time decision updates.
v1 contract: live push stream. Missed events during disconnect are NOT
replayed — clients needing completeness after reconnect should re-query
GET /v1/decisions and reconcile locally.
Events:
- connected: Sent once, after the server’s LISTEN subscription is active
- decision: New decision recorded (pushed via Postgres LISTEN/NOTIFY)
- heartbeat: Keep-alive ping (every 15s)
- error: Stream-level error (connection will close)
Example:
const es = new EventSource('/v1/decisions/stream', {
headers: { 'Authorization': 'Bearer <api-key>' }
});
es.addEventListener('decision', (e) => console.log(JSON.parse(e.data)));
Authorizations
MeshQu API key passed as a bearer token: Authorization: Bearer mqu_…. Mint one in the console (Settings → API keys).
Tenant UUID for multi-tenant isolation. Required on all authenticated routes — validated before authentication (middleware/tenant.ts), so a missing or non-UUID header returns 400 (MISSING_TENANT_ID / INVALID_TENANT_ID) before the API key is checked.
Response
SSE stream
SSE stream