Deleting attachments in Confluence Server

I have a situation where I need to be able to delete a number of attachments in Confluence. I have setup a process, where I delete the attachments sequentially, but I experience failures, even though the REST API call to delete the attachment reports success. I tried throttling the process, by forcing a 1 second wait time between deletes, but it appears that delete operations fail when there are multiple versions. Is there a way that I can know Confluence is ready to delete the next attachment, or do I need to delete version by version and place a cord coded delay between actions?

I have a alternate solution for your problem(its a little better than manual deleting)
You can go to confluence attachment directory and delete stuff. After that you can write a pearl or python script to update the current confluence database to delete or update broken links. If you setup this once(it can become a permanent solution)

There’s no need for a delay unless you expect that the Confluence instance is under high load (and want to spread the load over a longer period of time).

I have not seen the issue regarding deleting an attachment failing due to old versions. I used a DELETE on ‘https://my.instance.example.com/rest/api/content/att137462356/’, and it removed said attachment. Can you post the logs for the failed deletes?