Bulk Delete Files with REST API | Community
Skip to main content
anne_sample_f5
New Participant
June 20, 2023
Solved

Bulk Delete Files with REST API

  • June 20, 2023
  • 1 reply
  • 2783 views

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.

Best answer by Darshil_Shah1

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.

 

1 reply

Darshil_Shah1
Darshil_Shah1Accepted solution
Community Manager
June 20, 2023

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
New Participant
June 20, 2023

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
New Participant
June 20, 2023

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.