question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Purge API - how to delete messages and media content?

See original GitHub issue

Hi guys,

I am struggling with API. Want to make a cron task that will clean up a specific room (delete ALL messages) say every 24h. I am using the following command:

curl --header "Authorization: Bearer [my token]" -XPOST -H "Content-Type: application/json" -d '{ "purge_up_to_ts": 36000 }' "http://localhost:8003/_synapse/admin/v1/purge_history/[room_id]"

I get the following response - {“errcode”:“M_NOT_FOUND”,“error”:“there is no event to be purged”}

Similar issue happens with media folder. I use the following command:

curl --header "Authorization: Bearer [my token]" -XPOST "http://localhost:8003/_synapse/admin/v1/media/[server_name]/delete?before_ts=36000" and I get “{“deleted_media”:[],“total”:0}”

Any advice on how to fix it would be highly appreciated.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
richvdhcommented, Jun 22, 2021

I’m going to close this as it doesn’t seem to be a bug in synapse.

0reactions
dklimpelcommented, Jun 22, 2021

@dklimpel Yes, I understand the timestamp issue but even using 1624320000000 for timestamp gives me ‘curl no URL specified!’ error.

This is a curl problem. But without full command line there is no chance for help. Also the is a help romm in matrix: #synapse:matrix.org

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deleting Messages - Oracle Help Center
You can delete individual messages, multiple messages, or purge all messages from a queue. The DeleteMessage and DeleteMessages requests ...
Read more >
How to Delete All Messages in Discord - Alphr
1. One of the simpler methods to deleting all messages in a channel is to delete the channel. But you may not want...
Read more >
Deleting messages, message media or message bodies
You can delete individual records of messages or media associated with messages by using the HTTP DELETE functionality of the API.
Read more >
How to use REST with Web Content Manager to Purge Deleted ...
This API allows for the permanent removal of deleted content items. Note: The APIs to Purge Deleted Content items is available for HCL...
Read more >
Purge History API - Synapse
The purge history API allows server admins to purge historic events from their ... message in each room, so it will never delete...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found