purge historic events from Synapse database
synadm history [OPTIONS] COMMAND [ARGS]...
purge room events before a point in time or before an event ID.
The purge history API allows server admins to purge historic events from their database, reclaiming disk space.
Depending on the amount of history being purged a call to the API may take several minutes or longer. During this period users will not be able to paginate further back in the room from the point being purged from.
Note that Synapse requires at least one message in each room, so it will never delete the last message in a room.
By default, events sent by local users are not deleted, as they may represent the only copies of this content in existence. (Events sent by remote users are deleted.)
Room state data (such as joins, leaves, topic) is always preserved.
The API starts the purge running, and returns immediately with a JSON body with a purge id. Use ‘synadm history purge-status <purge id>’ to poll for updates on the running purge.
synadm history purge [OPTIONS] ROOM_ID
purge all history before this event ID. Event ID’s contain $, which is interpreted by the shell. Make sure it is surrounded by single quotes (‘id’).
purge all history before this number of days ago.
purge all history before this point in time. Eg. ‘2021-01-01’, see above for available date/time formats.
purge all history before this point in time giving a unix timestamp in ms.
this option overrides the default behavior and forces removal of events sent by local users.