Skip to main content
Question

API to delete AND Transfer files

  • May 21, 2025
  • 1 reply
  • 7 views

Forum|alt.badge.img

[sorry for the cross posting; put it in the wrong forum initially]

 

I can delete users with the API, as long as they have no content or I force the content to be deleted.  But is there a way in the API to delete the user and transfer to content to another user?

1 reply

Forum|alt.badge.img

Hi,

 

You have to use this API: https://developer.box.com/v2.0/reference#move-folder-into-another-users-folder

 

curl https://api.box.com/2.0/users/USER_ID/folders/FOLDER_ID \
-H "Authorization: Bearer ACCESS_TOKEN" \
-d '{"owned_by": {"id": "USER_ID"}}' \
-X PUT

Basically FOLDER_ID must be 0. Only supports rootfolder. This will move contents to another user ID, you can have user notified as well  if you want. 

And after that you can use delete API with "force" option.

force  boolean

Whether the user should be deleted even if this user still own files

 

Hope this helps.

 

thanks, 

Bibek