Skip to main content

Stream Notifications

GET 

/v2/auto/queries/:queryId/stream

Stream query notifications via Server-Sent Events (SSE).

Cost

Free.

Auth

Required header:

x-elfa-api-key: <api_key>

Request Example

Path parameter:

  • queryId (string)

Response Format (SSE)

Stream emits events in Server-Sent Events format:

id: <event-id>
event: notification:new
data: <JSON payload>

Event Types:

  • notification:new — New notification (query trigger, alert, etc.)
  • notification:count — Unread count update
  • ready — Connection established

notification:new payload example:

{
"id": 12345,
"type": "athena_query_notify_only",
"category": "alerts",
"title": "Query triggered: BTC > 100000",
"body": "BTC price crossed above 100000",
"data": {"queryId": "a12d20ff-6cb2-433e-afed-cc2e6a0380b6"},
"priority": "high",
"createdAt": "2026-04-01T12:00:00.000Z"
}

Note: id in the SSE frame header is the notification ID (numeric). data.queryId contains the query UUID. Use queryId to correlate with poll results.

Best practice: deduplicate SSE events by event id and process with a queue-backed worker for reliable agent execution.

Request

Responses

SSE stream established (text/event-stream)