Skip to main content
Question

Does a file deleted through an API end up in Trash?

  • May 22, 2025
  • 1 reply
  • 20 views

Forum|alt.badge.img

I'm trying to answer a question for a dev on whether a call to delete a file through an API will show that file in Trash or is it immediately gone?

1 reply

Forum|alt.badge.img

Hey, 

I'm not sure what app type or language you are using... but let's say you are using the cli

If you ran the command below, as a service account - it would delete the file putting it in the trash. 

box files:delete file_id

You can confirm this by traversing the trash file trash in the content explorer of the admin console or running this command with the cli

box trash:get file file_id_that_was_deleted --as-user=user_id_that_owned_the_file

Alex, Box Developer Advocate