https://man.liquidfiles.com
LiquidFiles Documentation

Deleting Attachments From Messages

A common scenario is if you've downloaded the attachments from a message, you want to delete the attachments, often to make scripting easier by downloading all available attachments from an account and then deleting the attachments afterwards. That way you can run the attachment download script as often as you need and not download an attachment twice.

Here's the API call to delete the attachment:

Request URL: /message/message_id/delete_attachments
Request VERB: DELETE

Example using curl

curl -s -X DELETE --user "$api_key:x" -H 'Content-Type: text/xml' https://test.host/message/tjXQlmeD8ZuJxacB6kfQh1/delete_attachments

Deleting All Attachments From Messages

Similarly, you can delete all available attachments using:

Here's the API call to delete the attachment:

Request URL: /message/delete_all_attachments
Request VERB: DELETE

Example using curl

curl -s -X DELETE --user "$api_key:x" -H 'Content-Type: text/xml' https://test.host/message/delete_all_attachments

Deleting an Uploaded Attachment

If you've uploaded a file but the user changes their mind and don't want to send it, it is possible to delete an attachment if you know the attachment ID. This would be used together with the sending files API when you've uploaded a file using the html form based method.

Request URL: /attachments/attachment_id
Request VERB: DELETE

Example using curl

curl -s -X DELETE --user "$api_key:x" -H 'Content-Type: text/xml' https://test.host/attachments/123