> 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.

# Update a location

PATCH https://{tenant_name}.benchling.com/api/v2/locations/{location_id}
Content-Type: application/json

Update a location

Reference: https://docs.benchling.com/docs/api/v2/benchling-api/locations/update-location

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `location_id` (string, required) — ID of the location to update

### Body (application/json)

This endpoint expects a LocationUpdate.

- `fields` (map from string to Field, optional)
- `name` (string, optional)
- `parentStorageId` (string, optional)

## Response

### 200

OK

- `archiveRecord` (ArchiveRecord, optional, nullable)
- `availableCapacity` (integer, optional, nullable) — The number of available positions in this location. Null if *totalCapacity* is not set.
- `barcode` (string, optional)
- `createdAt` (string, optional)
- `creator` (UserSummary, optional)
- `fields` (map from string to Field, optional)
- `id` (string, optional)
- `modifiedAt` (string, optional)
- `name` (string, optional)
- `occupiedCapacity` (integer, optional, nullable) — The number of plates, boxes, and containers currently in this location. Null if *totalCapacity* is not set.
- `parentStorageId` (string, optional, nullable)
- `schema` (SchemaSummary, optional, nullable)
- `totalCapacity` (integer, optional, nullable) — The total capacity of this location (i.e. how many plates, boxes, and containers it can store). If null, capacity is not limited.
- `webURL` (string, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `error` (BadRequestErrorError, optional)

### 403 Forbidden Error

Forbidden

- `error` (ForbiddenErrorError, optional)

### 404 Not Found Error

Not Found

- `error` (NotFoundErrorError, optional)

## Types

### Field

- `value` (FieldValue, required, nullable) — For single link fields, use the id of the item you want to link (eg. "seq_jdf8BV24"). For multi-link fields, use an array of ids of the items you want to link (eg. ["seq_jdf8BV24"])
- `displayValue` (string, optional, nullable)
- `isMulti` (boolean, optional)
- `textValue` (string, optional, nullable)
- `type` (enum, optional)
  - Allowed values: `dna_sequence_link`, `aa_sequence_link`, `custom_entity_link`, `entity_link`, `mixture_link`, `molecule_link`, `dropdown`, `part_link`, `translation_link`, `aa_part_link`, `base_molecule_link`, `blob_link`, `text`, `long_text`, `batch_link`, `storage_link`, `entry_link`, `assay_request_link`, `assay_result_link`, `assay_run_link`, `boolean`, `float`, `integer`, `datetime`, `date`, `json`

### ArchiveRecord

- `reason` (string, optional)

### UserSummary

- `handle` (string, optional)
- `id` (string, optional)
- `name` (string, optional)

### SchemaSummary

- `id` (string, optional)
- `name` (string, optional)

### BadRequestErrorError

- `message` (string, optional)
- `type` (enum, optional)
  - Allowed values: `invalid_request_error`
- `userMessage` (string, optional)

### ForbiddenErrorError

- `invalidId` (string, optional)
- `message` (string, optional)
- `type` (string, optional)
- `userMessage` (string, optional)

### NotFoundErrorError

- `message` (string, optional)
- `type` (enum, optional)
  - Allowed values: `invalid_request_error`
- `userMessage` (string, optional)
- `invalidId` (string, optional)

### FieldValue

For single link fields, use the id of the item you want to link (eg. "seq_jdf8BV24"). For multi-link fields, use an array of ids of the items you want to link (eg. ["seq_jdf8BV24"])

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "archiveRecord": {
    "reason": "Made in error"
  },
  "availableCapacity": 1,
  "barcode": "string",
  "createdAt": "string",
  "creator": {
    "handle": "string",
    "id": "string",
    "name": "string"
  },
  "fields": {},
  "id": "string",
  "modifiedAt": "string",
  "name": "string",
  "occupiedCapacity": 1,
  "parentStorageId": "string",
  "schema": {
    "id": "string",
    "name": "string"
  },
  "totalCapacity": 1,
  "webURL": "string"
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v2/locations/location_id"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{tenant_name}.benchling.com/api/v2/locations/location_id';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```