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

Category: Matrix & Synapse

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

Delete local media by age and size

Deletes local media files last accessed before before_ts and larger than size_gt bytes, which targets old big files while sparing small recent ones. keep_profiles defaults to true so profile avatars and room images survive. This is the cleanup command for runaway media storage. Remote caches are handled by purge_media_cache instead.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.