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:
Poll through the API
Your workspace API key needsrealtime:read. The first call returns data: [] and a nextCursor, establishing a checkpoint at the latest event, including in a workspace with no previous events.
data: up tolimitnotifications, 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.
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 whilehasMore 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 existingGET /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.
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 asLast-Event-ID, or use the endpoint’s cursor query parameter.
