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

# List boxes

GET https://{tenant_name}.benchling.com/api/v2/boxes

List boxes

Reference: https://docs.benchling.com/docs/api/v2/benchling-api/boxes/list-boxes

## Authentication

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

## Request

### Query parameters

- `pageSize` (integer, optional, default: 50) — Number of results to return. Defaults to 50, maximum of 100.
- `nextToken` (string, optional) — Token for pagination
- `sort` (enum, optional, default: modifiedAt:desc) — Method by which to order search results. Valid sorts are barcode, name, modifiedAt, and createdAt. Optionally add :asc or :desc to specify ascending or descending order. Default is modifiedAt.
  - Allowed values: `modifiedAt`, `modifiedAt:asc`, `modifiedAt:desc`, `name`, `name:asc`, `name:desc`, `createdAt`, `createdAt:asc`, `createdAt:desc`, `barcode`, `barcode:asc`, `barcode:desc`
- `schemaId` (string, optional) — ID of a schema. Restricts results to those of the specified schema.
- `schemaFields` (map from string to any, optional) — Filter based on schema field value (not display value). Restricts results to those with a field whose value matches the filter. For Integer, Float, and Date type fields, supports the >= and \<= operators (but not \< or >). If any schemaField filters are present, the schemaId param must also be present. Note that all operators must be separated from any values by a single space.
- `createdAt` (string, optional) — Datetime, in RFC 3339 format. Supports the > and \< operators. Time zone defaults to UTC. Restricts results to those created in the specified range. e.g. > 2017-04-30. Date ranges can be specified with the following nomenclature > YYYY-MM-DD AND \<YYYY-MM-DD.
- `modifiedAt` (string, optional) — Datetime, in RFC 3339 format. Supports the > and \< operators. Time zone defaults to UTC. Restricts results to those modified in the specified range. e.g. > 2017-04-30. Date ranges can be specified with the following nomenclature > YYYY-MM-DD AND \<YYYY-MM-DD.
- `name` (string, optional) — Name of a box. Restricts results to those with the specified name.
- `nameIncludes` (string, optional) — Name substring of a box. Restricts results to those with names that include the provided substring.
- `emptyPositions` (integer, optional) — Only return boxes that have the specified number of empty positions
- `emptyPositions.gte` (integer, optional) — Only return boxes that have greater-than or equal-to the specified number of empty positions.
- `emptyPositions.gt` (integer, optional) — Only return boxes that have greater-than the specified number of empty positions.
- `emptyPositions.lte` (integer, optional) — Only return boxes that have less-than or equal-to the specified number of empty positions.
- `emptyPositions.lt` (integer, optional) — Only return boxes that have less-than the specified number of empty positions.
- `emptyContainers` (integer, optional) — Only return boxes that have the specified number of empty containers (containers without contents).
- `emptyContainers.gte` (integer, optional) — Only return boxes that have greater-than or equal-to the specified number of empty containers (containers without contents).
- `emptyContainers.gt` (integer, optional) — Only return boxes that have greater-than the specified number of empty containers (containers without contents).
- `emptyContainers.lte` (integer, optional) — Only return boxes that have less-than or equal-to the specified number of empty containers (containers without contents).
- `emptyContainers.lt` (integer, optional) — Only return boxes that have less-than the specified number of empty containers (containers without contents).
- `ancestorStorageId` (string, optional) — ID of a location. Restricts results to those located in the specified inventory.
- `storageContentsId` (string, optional) — ID of a entity, or entity schema. Restricts results to those that hold containers with entities associated with the specified ID.
- `storageContentsIds` (string, optional) — Comma-separated list of IDs of entities. Restricts results to those that hold containers with at least one of the specified entities.
- `archiveReason` (string, optional) — Archive reason. Restricts items to those with the specified archive reason. Use "NOT_ARCHIVED" to filter for unarchived boxes. Use "ANY_ARCHIVED" to filter for archived boxes regardless of reason. Use "ANY_ARCHIVED_OR_NOT_ARCHIVED" to return items for both archived and unarchived.
- `ids` (string, optional) — Comma-separated list of ids. Matches all of the provided IDs, or returns a 400 error that includes a list of which IDs are invalid.
- `barcodes` (string, optional) — Comma-separated list of barcodes. Matches all of the provided barcodes, or returns a 400 error that includes a list of which barcodes are invalid.
- `names.anyOf` (string, optional) — Comma-separated list of names. Maximum of 100. Restricts results to those that match any of the specified names, case insensitive. Warning - this filter can be non-performant due to case insensitivity.
- `names.anyOf.caseSensitive` (string, optional) — Comma-separated list of names. Maximum of 100. Restricts results to those that match any of the specified names, case sensitive.
- `creatorIds` (string, optional) — Comma separated list of users IDs

## Response

### 200

OK

- `boxes` (list of Box, optional)
- `nextToken` (string, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `error` (BadRequestErrorError, optional)

## Types

### Box

- `archiveRecord` (ArchiveRecord, optional, nullable)
- `availableCapacity` (integer, optional) — The number of available positions in the box.
- `barcode` (string, optional, nullable)
- `createdAt` (datetime, optional)
- `creator` (UserSummary, optional)
- `emptyContainers` (integer, optional) — The number of containers in the box that have no contents.
- `emptyPositions` (integer, optional) — The number of empty positions for adding additional containers in the box.
- `fields` (map from string to Field, optional)
- `filledPositions` (integer, optional) — The number of containers currently in the box.
- `id` (string, optional)
- `modifiedAt` (datetime, optional)
- `name` (string, optional)
- `occupiedCapacity` (integer, optional) — The number of containers currently in the box.
- `parentStorageId` (string, optional, nullable)
- `projectId` (string, optional, nullable)
- `schema` (SchemaSummary, optional, nullable)
- `size` (integer, optional) — The size of the box (i.e. how many containers it can store).
- `totalCapacity` (integer, optional) — The total capacity of the box (i.e. how many containers it can store).
- `webURL` (string, optional)

### BadRequestErrorError

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

### ArchiveRecord

- `reason` (string, optional)

### UserSummary

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

### 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`

### SchemaSummary

- `id` (string, optional)
- `name` (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

**Response**

```json
{
  "boxes": [
    {
      "archiveRecord": {
        "reason": "Made in error"
      },
      "availableCapacity": 1,
      "barcode": "string",
      "createdAt": "2024-01-15T09:30:00Z",
      "creator": {
        "handle": "string",
        "id": "string",
        "name": "string"
      },
      "emptyContainers": 1,
      "emptyPositions": 1,
      "fields": {},
      "filledPositions": 1,
      "id": "string",
      "modifiedAt": "2024-01-15T09:30:00Z",
      "name": "string",
      "occupiedCapacity": 1,
      "parentStorageId": "string",
      "projectId": "string",
      "schema": {
        "id": "string",
        "name": "string"
      },
      "size": 1,
      "totalCapacity": 1,
      "webURL": "string"
    }
  ],
  "nextToken": "string"
}
```

**SDK Code**

```python
import requests

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

querystring = {"archiveReason":"NOT_ARCHIVED","createdAt":"> 2022-03-01 AND < 2022-04-01","modifiedAt":"> 2022-03-01 AND < 2022-04-01"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://{tenant_name}.benchling.com/api/v2/boxes?archiveReason=NOT_ARCHIVED&createdAt=%3E+2022-03-01+AND+%3C+2022-04-01&modifiedAt=%3E+2022-03-01+AND+%3C+2022-04-01';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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