curl -sS -X PUT 'https://matrix.example.com/_matrix/client/v3/rooms/!abc123:example.com/redact/$143273582443PhrSn:example.org/txn1' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{"reason":"spam"}'

Category: Matrix & Synapse

curl -sS -X PUT 'https://matrix.example.com/_matrix/client/v3/rooms/!abc123:example.com/redact/$143273582443PhrSn:example.org/txn1' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{"reason":"spam"}'

Redact a single message event

Replaces the message content with a notice that it was removed, keeping the event's place in history. The reason is attached to the redaction. Requires sufficient power level, and the transaction ID prevents duplicate redactions on retry. For bulk cleanup use the admin redact endpoint, which can redact many of a user's events at once.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.