Skip to content

Events

Follow live changes and resume an event stream after a disconnect.

1 endpoints API 0.5.1-rc.3

Read the usage guide

Stream live message changes with server-sent events

#

Operation ID: streamEvents

relayToken
GET/v1/events

One authenticated SSE stream. Event data contains stable resource IDs, not complete resources. Reconnect with Last-Event-ID for bounded in-process replay. Replay does not survive a restart. stream.reset can require a REST refetch or provide a safe replay cursor. Replayed events can be duplicated. The stream starts with retry: 3000 and sends keep-alive comments every 15 seconds. Comments are ignored by SSE parsing. Database and authentication failures before streaming starts use the normal JSON error shape.

Request

Request headers

Last-Event-IDstringOptional

Last received SSE event ID for replay.

Responses

200Parsed SSE frames. Each data field is a string containing a JSON payload.
Cache-ControlstringRequired
Value: "no-cache"
X-Accel-BufferingstringRequired
Value: "no"

Content type text/event-stream

Stream frame

Exactly one of these8 variants
object
dataRequired
string
Validation rules
Encoded content type
application/json
JSON string contents
eventRequired
stringValue: "stream.ready"
idOptional
string
object
dataRequired
string
Validation rules
Encoded content type
application/json
JSON string contents
eventRequired
stringValue: "message.created"
idOptional
string
object
dataRequired
string
Validation rules
Encoded content type
application/json
JSON string contents
eventRequired
stringValue: "message.updated"
idOptional
string
object
dataRequired
string
Validation rules
Encoded content type
application/json
JSON string contents
eventRequired
stringValue: "reaction.added"
idOptional
string
object
dataRequired
string
Validation rules
Encoded content type
application/json
JSON string contents
eventRequired
stringValue: "reaction.removed"
idOptional
string
object
dataRequired
string
Validation rules
Encoded content type
application/json
JSON string contents
eventRequired
stringValue: "media.available"
idOptional
string
object
dataRequired
string
Validation rules
Encoded content type
application/json
JSON string contents
eventRequired
stringValue: "stream.reset"
idOptional
string
object
retryRequired
integerValue: 3000

Other fields are not accepted.

401, 500, 503Error responses
401
Missing or invalid bearer token.
500
The request failed.
503
The database, sender, Messages access, or request store is unavailable.

Content type application/json

Headers on every response
X-Request-IDstringRequired

Request correlation identifier.