curl -sS 'https://matrix.example.com/_synapse/admin/v1/rooms/!abc123:example.com/messages?from=t29-57_2_0_2&limit=50&dir=b' -H "Authorization: Bearer $ACCESS_TOKEN"

Category: Matrix & Synapse

curl -sS 'https://matrix.example.com/_synapse/admin/v1/rooms/!abc123:example.com/messages?from=t29-57_2_0_2&limit=50&dir=b' -H "Authorization: Bearer $ACCESS_TOKEN"

Read back messages in a room as admin

Fetches message events from a room regardless of your membership, which the normal client API would refuse. The from token is a pagination token, dir=b walks backwards through history, and limit caps the batch. Responses include an end token to continue paging. Use the timestamp_to_event endpoint to jump to a date.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.