Room participation
Listen on the event stream of a particular room.
This will listen for new events related to a particular room and return them to the caller. This will block until an event is received, or until the timeout is reached.
This API is the same as the normal /events endpoint, but can be called by users who have not joined the room.
Note that the normal /events endpoint has been deprecated. This API will also be deprecated at some point, but its replacement is not yet known.
get/_matrix/client/v3/events
Request
- Base URLhttps://matrix.org
- Auth
- API key in query parameter access_token
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
fromstring
The token to stream from. This token is either from a previous request to this API or from the initial sync API.
timeoutinteger
The maximum time in milliseconds to wait for an event.
room_idstring required
The room ID for which events should be returned.
Response
The events received, which may be none.
Example response
{
"chunk": [
{
"content": {
"membership": "join"
},
"event_id": "$26RqwJMLw-yds1GAH_QxjHRC1Da9oasK0e5VLnck_45",
"origin_server_ts": 1632489532305,
"sender": "@example:example.org",
"state_key": "@user:example.org",
"type": "m.room.member",
"unsigned": {
"age": 1567437,
"membership": "join",
"redacted_because": {
"content": {
"reason": "spam"
},
"event_id": "$Nhl3rsgHMjk-DjMJANawr9HHAhLg4GcoTYrSiYYGqEE",
"origin_server_ts": 1632491098485,
"redacts": "$26RqwJMLw-yds1GAH_QxjHRC1Da9oasK0e5VLnck_45",
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
"sender": "@moderator:example.org",
"type": "m.room.redaction",
"unsigned": {
"age": 1257
}
}
},
"room_id": "!jEsUZKDJdhlrceRyVU:example.org"
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.