Org-wide live activity stream (SSE)
const url = 'https://your-org.evershell.ai/v1/activity/stream';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://your-org.evershell.ai/v1/activity/stream \ --header 'Authorization: Bearer <token>'Permissions: workspace:read or workspace:read:own —
callers with the unscoped variant receive every workspace’s
events; :own callers receive only events from workspaces
they created (handler filters per event by user_id).
Server-sent events. Pushes every category=activity event
across the caller’s org as it’s emitted. Filter the stream
client-side or by workspace via
/workspaces/{id}/activity/stream. The CP holds the
connection open up to sseMaxStreamDuration (5 minutes
today) then closes it cleanly so browsers’ EventSource can
auto-reconnect; clients that aren’t EventSource should
reconnect on close.
Heartbeats are sent as SSE comment lines (: heartbeat\n\n)
roughly every 15 seconds.
SSE consumers that can’t set headers may present the API
key in the query string: ?api_key=sk_live_....
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”API key fallback for SSE clients that can’t set Authorization headers.
Responses
Section titled “ Responses ”Event stream
Each event has shape event: activity\nid: <event id>\ndata: <JSON AuditEvent>\n\n.
See the AuditEvent schema for the payload shape.