Get a list of events for this room

GET {{baseUrl}}/rooms/:roomId/messages?from=s345_678_333&to=eiusmod veniam&dir=b&limit=-66300513&filter={"contains_url":true}

This API returns a list of message and state events for a room. It uses pagination query parameters to paginate history in the room.

Note: This endpoint supports lazy-loading of room member events. See Lazy-loading room members for more information.

Request Params

KeyDatatypeRequiredDescription
fromstring(Required) The token to start returning events from. This token can be obtained
from a prev_batch or next_batch token returned by the /sync endpoint,
or from an end token returned by a previous request to this endpoint.

This endpoint can also accept a value returned as a start token by a previous request to this endpoint, though servers are not required to support this. Clients should not rely on the behaviour. | | to | string | | The token to stop returning events at. This token can be obtained from a prev_batch or next_batch token returned by the /sync endpoint, or from an end token returned by a previous request to this endpoint. | | dir | string | | (Required) The direction to return events from. If this is set to f, events will be returned in chronological order starting at from. If it is set to b, events will be returned in reverse chronological order, again starting at from. | | limit | number | | The maximum number of events to return. Default: 10. | | filter | string | | A JSON RoomEventFilter to filter returned events with. |

RESPONSES

status: OK

{"start":"t47429-4392820_219380_26003_2265","end":"t47409-4357353_219380_26003_2265","chunk":[{"$ref":"../../event-schemas/examples/m.room.message$m.text.yaml"},{"$ref":"../../event-schemas/examples/m.room.name.yaml"},{"$ref":"../../event-schemas/examples/m.room.message$m.video.yaml"}]}