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 updateready— 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:
idin the SSE frame header is the notification ID (numeric).data.queryIdcontains the query UUID. UsequeryIdto 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
- 200
- 204
- 401
- 404
- 410
SSE stream established (text/event-stream)
No content
Missing or invalid API key
Query not found
Query stream closed