Skip to main content
Every endpoint on this page requires either a Clerk-issued JWT (Authorization: Bearer <token>) or an organization API key (x-api-key: pk_…). Anonymous calls return 401 Unauthorized. See Authentication for the full setup.
Agntix exposes a single Server-Sent Events stream per organization at GET /v1/chat/events/stream. Use it to update dashboards, push notifications, or trigger downstream automation.

Connect

const es = new EventSource(
  "https://api.agntix.ai/v1/chat/events/stream",
  { withCredentials: true } // or use ?token=… for environments without cookie support
);

es.addEventListener("message.added", (e) => {
  const payload = JSON.parse(e.data);
  console.log("new message in", payload.sessionId, payload);
});

Event types

EventTriggered when
session.startedA new chat or voice session is created
session.updatedSession state, agent assignment, or analytics change
session.endedSession is closed (manually, expired, or call ended)
message.addedA new message is added to a session
usage.updatedUsage metrics for the org change
subscription.updatedPlan change, cancel, or resume
knowledge_store.updatedA knowledge store document finishes processing
heartbeatSent every 30s; use to detect a dead connection

Reconnecting

The browser’s EventSource reconnects automatically with the Last-Event-ID header. Keep your client side-effect-free with respect to event order — at least one delivery is guaranteed, ordering is not.
Looking for at-least-once delivery with replay? Subscribe via Webhooks instead. SSE is fire-and-forget; webhooks are durable.