Skip to main content
Question

Query an user if there are content in their account

  • May 22, 2025
  • 2 replies
  • 20 views

Forum|alt.badge.img

Hi - I am creating an integration app to delete users that left the organization and there are no content in their account. How do I use Box SDK to see if there are content in user's account? Do I need to get a total folder count? Thank you. 

2 replies

Forum|alt.badge.img

It's possible to see how much data a given account contains (the "space_used" parameter of https://developer.box.com/reference#users), but that doesn't include three things that may prevent you from successfully deleting the account:

  • Box Notes
  • Box Web links/bookmarks
  • Folders

What most folks I've seen do is to either:

1) Use the "Move Owned Items" call (https://developer.box.com/reference#move-folder-into-another-users-folder) to move everything owned by the user to be deleted into another user, then delete the original user

 

2) If deleting a user with 0 space_used fails, enumerate the contents of that user's root folder and delete any items found before retrying.

 

Hope that helps!

 

Ian Crew

UC Berkeley


Forum|alt.badge.img

Okay Thanks for your help!