Events
The server-sent event stream and its polling twin.
GET /v3/events is a server-sent event stream; GET /v3/events/since returns the same records as a JSON page for clients that cannot hold a connection.
Stream behaviour (from the server code):
- The first line is
retry: 2000(the poll interval in milliseconds). - Each event is written as
id: <cursor>,event: <type>,data: <StreamEvent JSON>. - Start position: the
cursorquery parameter, else theLast-Event-IDheader, else the current head (no replay of old events). - The session is re-checked on every poll. If it ends or the principal loses access, the server sends
event: CONTEXT_REVOKEDand closes. - A
: keep-alivecomment is written about every 15 seconds. - A connection stays open for at most 10 minutes; reconnect with the last cursor.
- Events are filtered to contexts the principal belongs to, and membership is re-checked by each query.
Event types: LEAD_UPDATED, LEAD_MESSAGE, OFFER_UPDATED, AGENT_EVENT, APPROVAL_CHANGED, BALANCE_CHANGED, NOTIFICATION, CONTEXT_REVOKED. Cursors are decimal strings and increase monotonically.
GET /v3/events?cursor=1042
retry: 2000
id: 1043
event: LEAD_MESSAGE
data: {"cursor":"1043","type":"LEAD_MESSAGE", ...}
: keep-aliveRoutes#
GET /v3/events#
Server-sent StreamEvent records; replay from a cursor.
| Route id | events.stream |
| Auth | Session (bearer or cookie) |
| Who may call | principal; events filtered to their contexts |
| Status | IMPLEMENTED |
Query parameters
| Field | Type | Required | Notes |
|---|---|---|---|
cursor | string (max 200, min 1) | no |
Response: text/event-stream. Each event carries a StreamEvent as its data line. See Events.
GET /v3/events/since#
Same events as the stream, for clients that cannot hold a connection.
| Route id | events.poll |
| Auth | Session (bearer or cookie) |
| Who may call | principal |
| Status | IMPLEMENTED |
Query parameters
| Field | Type | Required | Notes |
|---|---|---|---|
cursor | string (max 200, min 1) | no |
Response (StreamEventPage)
| Field | Type | Required | Notes |
|---|---|---|---|
items | StreamEvent[] | yes | |
nextCursor | string (max 200, min 1) or null | yes |