curl -sS -X POST 'https://matrix.example.com/_synapse/admin/v1/purge_media_cache?before_ts=1735689600000' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{}'

Category: Matrix & Synapse

curl -sS -X POST 'https://matrix.example.com/_synapse/admin/v1/purge_media_cache?before_ts=1735689600000' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{}'

Purge cached remote media older than a date

Deletes locally cached copies of remote media last accessed before the given millisecond timestamp, freeing disk space on federated servers. If a user later requests purged media, Synapse re-fetches it from the origin server. before_ts is a Unix timestamp in milliseconds, for example 1735689600000 is 2025-01-01. Combine with size_gt-style filters on the media delete endpoint for local files.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.