Message retention policies exist at a room level, follow the semantics described in [MSC1763](https://github.com/matrix-org/matrix-doc/blob/matthew/msc1763/proposals/1763-configurable-retention-periods.md), and allow server and room admins to configure how long messages should be kept in a homeserver's database before being purged from it.
Please note that, as this feature isn't part of the Matrix specification yet, this implementation is to be considered as experimental.
A message retention policy is mainly defined by its `max_lifetime` parameter, which defines how long a message can be kept around after it was sent to the room. If a room doesn't have a message retention policy, and there's no default one for a given server, then no message sent in that room is ever purged on that server.
MSC1763 also specifies semantics for a `min_lifetime` parameter which defines the amount of time after which an event can get purged (after it was sent to the room), but Synapse doesn't currently support it beyond registering it.
Both `max_lifetime` and `min_lifetime` are optional parameters.
!!! note
Note that message retention policies don't apply to state events.
more information about Message retention policies can find [here](https://github.com/matrix-org/synapse/blob/master/docs/message_retention_policies.md).