Skip to main content
GET
/
v1
/
notifications
/
stream
Notifications SSE stream
curl --request GET \
  --url https://api.example.com/v1/notifications/stream \
  --header 'Authorization: <authorization>'

Overview

Opens a persistent Server-Sent Events (SSE) connection for real-time notification delivery. This is the primary real-time delivery mechanism for all 20 CauseFlow outbound events. The connection stays open until the client disconnects. Required role: admin or member
This is the live real-time delivery endpoint for CauseFlow events today. Programmatic webhook subscription (POST to an HTTPS endpoint) is roadmap — see the outbound event catalog for details.

Request headers

Authorization
string
required
JWT Bearer token. Format: Bearer <your-jwt>.

Connection

URL: https://api.causeflow.ai/v1/notifications/stream Required header: Authorization: Bearer <token> Response content-type: text/event-stream

Event types

Event typeDescription
investigation.progressAn investigation step completed
investigation.completedFull investigation pipeline finished
investigation.known_solution_foundMatching runbook or prior incident found
remediation.proposedAI proposed a remediation plan
remediation.approvedTeam member approved a remediation
remediation.rejectedTeam member rejected a remediation
remediation.executedRemediation action completed
incident.createdNew incident created
incident.status_changedIncident status transitioned
approval.requestedA step requires manual approval
approval.resolvedAn approval was granted or rejected
pingKeepalive heartbeat every 30 seconds

Event format

id: evt_01HX9VTPQR3KF8MZWBYD5N6JCE
event: investigation.progress
data: {"type":"investigation.progress","incidentId":"inc_EXAMPLE_01JX","message":"Found 10,000 errors across 3 services","agentName":"log analysis","timestamp":"2024-04-01T14:32:10Z"}

id: evt_01HX9VTPQR3KF8MZWBYD5N6JCF
event: remediation.proposed
data: {"type":"remediation.proposed","incidentId":"inc_EXAMPLE_01JX","remediationId":"rem_01HX9VTPQR3KF8MZWBYD5N6JCE","title":"Scale connection pool from 50 to 150","requiresApproval":true,"timestamp":"2024-04-01T14:35:00Z"}

id: evt_01HX9VTPQR3KF8MZWBYD5N6JCG
event: ping
data: {}

Reconnection

Reconnect with the Last-Event-ID header to resume from the last received event. The server delivers any events missed since that ID:
GET /v1/notifications/stream
Authorization: Bearer eyJhbGc...
Last-Event-ID: evt_01HX9VTPQR3KF8MZWBYD5N6JCF

Examples

// Browser EventSource (no custom header support — use token in query param or polyfill)
const eventSource = new EventSource(
  "https://api.causeflow.ai/v1/notifications/stream?token=<jwt>"
);

eventSource.addEventListener("investigation.progress", (e) => {
  const data = JSON.parse(e.data);
  console.log(`[${data.agentName}] ${data.message}`);
});

eventSource.addEventListener("remediation.proposed", (e) => {
  const data = JSON.parse(e.data);
  console.log(`Remediation ready: ${data.title} (approval required: ${data.requiresApproval})`);
});

eventSource.onerror = () => {
  console.error("SSE connection dropped — browser will reconnect automatically");
};

Outbound event catalog

All 20 events with full payload samples

List notifications

Poll notifications if SSE is unavailable