Skip to main content
Question

API call to delete files?

  • May 22, 2025
  • 3 replies
  • 39 views

Forum|alt.badge.img

Hello - I'm trying to remove multiple files from multiple users within Box. Manually this will take a very long time and I thought Box CLI may work. 

 

Have any of you done this before and can either guide me or supply me with a script that I edit for my specific request? 

 

Any assistance would be appreciated. 

 

Thanks!

3 replies

Forum|alt.badge.img

Hello , 

 

Great question! The CLI would definitely be a great tool to use here. 

 

Here's the command you would run: 

 

box files:delete FILEIDHERE

 

This does support using a bulk CSV and if you wanted to do that you'd create a .csv file with one column named ID. This would contain each file ID you wanted to delete. The command to run that would become: 

 

box files:delete --bulk-file-path=BULKFILEPATHHERE

 

Best, 


Forum|alt.badge.img

You rock. Thank you for the quick reply. I'll look into and respond with my results. 

 


Forum|alt.badge.img

Is there a way to introduce a wildcard? Deleting by file ID will work however we have several users that can changed the name and I believe that changes the file ID. 

 

Would a script be a better choice for this rather than CLI?