Confluence REST API Lacks DELETE Method for Attachments
Symptoms
Upon reviewing the Confluence REST API Documentation for Attachments, you will note that the documentation states that the /rest/api/content/{id}/child/attachment methods are for "CRUD operations for Attachments on Content". CRUD operations implies that this should cover Copy, Read, Update and Delete in order to be truly CRUD operations-complete, however, there is no method for attachment deletion on this resource as of this writing. If you try to use a DELETE command, no return will be forthcoming using the REST API.
Cause
The cause is that the DELETE command is not available and exposed on the /rest/api/content/{id}/child/attachment/{attachmentid} resource.
Workaround
In the REST API, attachments are content. You can use the DELETE command for the attachment id on the /rest/api/content/{id} resource to delete all versions of the given attachment.
Another workaround to allow programmatic deletion of attachments is to use a third-party tool, the Confluence CLI which provides methods to removeAttachment, removeAttachmentVersion and removeAttachmentVersions and is a supported Add-on for Confluence.
Resolution
At present, there is an open issue - CONF-36015Getting issue details... STATUS
Please consider voting for this issue if it is important to you.