Skip to main content
Question

Issue with the Box CLI moving subfolders

  • May 22, 2025
  • 1 reply
  • 47 views

Forum|alt.badge.img

I am using the Box CLI to move files into an archive folder which is owner by another user, using the process outlined in this post (the response by Murtza  3 posts down: https://community.box.com/t5/Platform-and-Development-Forum/Is-there-a-API-to-transfer-ownership-of-folder-s-to-another/td-p/50536)

 

Now this all works fine when moving a normal folder.

 

However, if I try and move a subfolder of a collaborated folder, it gives me an error when moving (using box folders:move to move after adding the collaborators):

 

Unexpected API Response [400 Bad Request | uiufv6ghezj5shzi.0cc573e654e0834fc06f3bd8bb6a6f035] cannot_make_collaborated_subfolder_private - Cannot move a collaborated subfolder to a private folder unless the new owner is explicitly specified.

 

According to this https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/

 

Error

cannot_make_collaborated_subfolder_private

Message

Cannot move a collaborated folder to a private folder unless the new owner is explicitly specified

Solution

Specify the ID of the user that the content should be transferred to by setting the owned_by.id field in the request.

 

 

So this is all very well, however the according to the API box folders:move does not have any options for setting the new owner during the move. The destination user is already co-owner so there is nothing more I can add.

 

Is this just missing from Box CLI, and if so is there anything I can do to fix this?

 

Thanks

1 reply

Forum|alt.badge.img

Hi, this is currently not possible with the CLI. We recommend using cURL or one of our SDKs directly.