SOLVED

Bulk Delete Files with REST API

Go to solution
anne_sample_f5
Level 4

Bulk Delete Files with REST API

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Bulk Delete Files with REST API

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.

 

View solution in original post

4 REPLIES 4
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Bulk Delete Files with REST API

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.

 

anne_sample_f5
Level 4

Re: Bulk Delete Files with REST API

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.

SanfordWhiteman
Level 10 - Community Moderator

Re: Bulk Delete Files with REST API

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.

anne_sample_f5
Level 4

Re: Bulk Delete Files with REST API

Thanks - I put in an Idea for the suggestion but I'll take a look at your post about it too!