I am wondering if anyone knows of a way to bulk delete files via the REST API. We have a large number of unused image files from 10+ years ago that I need to purge. Deleting them 30 at a time in the UI is slowly draining my life force.
Is there a way I can use the API to do this? I've successfully been able to GET lists of files, but don't see any documentation on actually removing them.
Solved! Go to Solution.
There isn't an API endpoint to delete files in Asset > Files API endpoints. You can switch to the old UX for deleting files as you would be able to view 50 files as opposed to 30 files in the Modern Next-Gen UX.
There isn't an API endpoint to delete files in Asset > Files API endpoints. You can switch to the old UX for deleting files as you would be able to view 50 files as opposed to 30 files in the Modern Next-Gen UX.
Thanks, I realized after posting that the old UI was slightly more efficient, but was realllllly hoping there was a method that could deal with more than 50 at a time. I'm dealing with literal thousands of assets here so even 50 at a time is pretty brutal.
I didn't see it in the endpoint list either, but I wasn't sure if the list was comprehensive or if there was another trick to it somehow. Thanks for confirming.
You could definitely — if you’re delicate and test robustly in sandbox — automate this on the front end. It’s in the same vein as my blog post on exporting all the Roles + Permissions from a Marketo instance.
But no supported method, like Darshil says.
Thanks - I put in an Idea for the suggestion but I'll take a look at your post about it too!