Skip to main content
Use MCP or JSON polling to check for changes without holding a connection open. Use SSE for a continuous server connection, or webhooks for background event delivery.

Check changes with your AI

Grant Read workspace event notifications (realtime:read) when connecting. Existing OAuth connections need new consent for this permission. It reveals workspace event types and resource identifiers; it does not grant permission to read the referenced resources. Start with this prompt:
When you want another check:
The tool returns immediately. A call does not subscribe your assistant or schedule future checks. Your client or application must retain the cursor and invoke the tool again. See Available tools for access details.

Poll through the API

Your workspace API key needs realtime:read. The first call returns data: [] and a nextCursor, establishing a checkpoint at the latest event, including in a workspace with no previous events.
For subsequent checks, supply the returned cursor and keep the filters unchanged:
Each page contains:
  • data: up to limit notifications, with event ID, type, resource type, resource ID, creation time, and conversation ID when associated.
  • nextCursor: the checkpoint to save after processing the page. An empty page retains the checkpoint.
  • hasMore: whether another page was available at the time of the query.
  • pollAfterSeconds: wait at least this many seconds before an idle poll; currently three seconds.
The default limit is 25; the maximum is 100. Optional conversationId and comma-separated eventTypes narrow the results. Notifications omit message bodies and other event payloads. Fetch the current customer, conversation, or message through its regular endpoint and required read scope. See the polling reference.

Resume safely

Save the cursor after processing a page. Retry the same input cursor after a failed request, and deduplicate by event ID. Drain pages while hasMore is true, then wait before checking again. Treat notifications as hints to refresh resource state, not an exactly-once delivery log. Poll cursors belong to one workspace and are not interchangeable with SSE event IDs. An invalid, foreign-workspace, or unavailable cursor returns 400 realtime.invalid_cursor. Start a new checkpoint and reconcile current resources; do not interpret the error as “no changes.” Changing filters does not recover events already skipped by a prior checkpoint. Polling follows the outbox’s creation-time order, not transaction commit order. A transaction that commits late can fall behind a saved checkpoint. Use authoritative resource reads to reconcile state and webhooks for durable background processing. The polling response does not include historical resource snapshots.

Open a stream

The existing GET /realtime/events endpoint exposes a workspace event stream using server-sent events (SSE). Your API key needs realtime:read. Unlike JSON notifications, SSE carries the workspace outbox payloads.
Events use SSE id, event, and data fields. Parse complete events before processing them. A new connection without a cursor listens for live events.

Reconnect and resume a stream

Save the last successfully processed event ID. On reconnection, send it as Last-Event-ID, or use the endpoint’s cursor query parameter.
Expect heartbeats and periodic disconnections. Reconnect with backoff, deduplicate event IDs, and handle stream errors. Consult the SSE reference.

Connect through your server

Keep workspace API keys on your server, out of browser JavaScript and URLs. Forward only updates that an authenticated application user is authorized to see. This workspace API is separate from the customer-facing embedded chat realtime connection.