Move a Box to a New Location Using the V3 SDK
This recipe uses the V3 API through the
V3 Python SDK. The box list and update endpoints are
stable, so the client doesn’t need early_access.
SDK boilerplate
Import the V3 SDK and instantiate the client. Pass your tenant’s root URL and your API key; the SDK adds
/api/v3itself.Find the box's API ID from its name
Moving a box means referring to it by API ID, so start with
box.list()filtered on the box’s name and print the IDs it comes back with.name_any_ofmatches case-insensitively; usename_any_of_case_sensitivefor an exact match. Iterating the pager fetches every page for you. Paste the ID you want intobox_idbelow.Move the box to the new location
box.update()takes the box’s API ID and the fields to change as keyword arguments. Setparent_storage_idto the API ID of the location you want the box in. The commented-out arguments show what else you can change in the same call, such as the box’s name, barcode, schema fields, or project. Arguments you leave out are not sent, so they stay as they are.Handle the update response
box.update()returns the updated box. Its new location isparent_storage, a reference with the location’sid. This example keeps the name, ID, and new location in case a later step needs them.