Using the Purge Remote Media API, we can send a POST request to delete all cached remote media before a certain time:
Your account must be a server admin for this command to work.
before_ts takes time in UNIX epoch milliseconds, the one in the template is at 2023-01-01 00:00.
You can generate one [here] (https://currentmillis.com/)z
Generating an access token
If you don’t have an access token, you can also generate one using curl: