> This page is for Developer Documentation.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.benchling.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.benchling.com/_mcp/server.

# Move a Box to a New Location Using the V3 SDK

This recipe uses the [V3 API](/docs/v3-api-overview) through the
[V3 Python SDK](/docs/getting-started-with-the-v3-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/v3` itself.

**`Python (lines 1-6)`**

```python Python (lines 1-6)
from benchling_v3_sdk import Benchling

benchling = Benchling(
    base_url="https://yourcompany.benchling.com",
    api_key="<your-api-key>",
)
```

#### 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_of` matches case-insensitively; use
`name_any_of_case_sensitive` for an exact match. Iterating the pager fetches every page for you.
Paste the ID you want into `box_id` below.

**`Python (lines 8-14)`**

```python Python (lines 8-14)
box_name = "FreezerBox1"

def get_box_id(box_name):
    for box in benchling.box.list(name_any_of=[box_name]):
        print(box.id)

get_box_id(box_name)
```

#### Move the box to the new location

`box.update()` takes the box's API ID and the fields to change as keyword arguments. Set
`parent_storage_id` to 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.

**`Python (lines 17-27)`**

```python Python (lines 17-27)
box_id = "box_fooBar"

def move_box(box_id):
    box = benchling.box.update(
        box_id,
        parent_storage_id="loc_oR1099Ds",
        # name="",
        # barcode="",
        # schema_fields={},
        # project_id="",
    )
```

#### Handle the update response

`box.update()` returns the updated box. Its new location is `parent_storage`, a reference with
the location's `id`. This example keeps the name, ID, and new location in case a later step
needs them.

**`Python (lines 29-36)`**

```python Python (lines 29-36)
    updated_box = {}
    updated_box["name"] = box.name
    updated_box["id"] = box.id
    updated_box["new_location"] = box.parent_storage.id
    return updated_box

new_location = move_box(box_id)
print(new_location)
```

#### Complete files

**`Python`**

```python title="Python"
from benchling_v3_sdk import Benchling

benchling = Benchling(
    base_url="https://yourcompany.benchling.com",
    api_key="<your-api-key>",
)

box_name = "FreezerBox1"

def get_box_id(box_name):
    for box in benchling.box.list(name_any_of=[box_name]):
        print(box.id)

get_box_id(box_name)


box_id = "box_fooBar"

def move_box(box_id):
    box = benchling.box.update(
        box_id,
        parent_storage_id="loc_oR1099Ds",
        # name="",
        # barcode="",
        # schema_fields={},
        # project_id="",
    )

    updated_box = {}
    updated_box["name"] = box.name
    updated_box["id"] = box.id
    updated_box["new_location"] = box.parent_storage.id
    return updated_box

new_location = move_box(box_id)
print(new_location)
```