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

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

List molecules

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

## 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 name, modifiedAt, and createdAt. Optionally add :asc or :desc to specify ascending or descending order. Default is modifiedAt.
  - Allowed values: `createdAt`, `createdAt:asc`, `createdAt:desc`, `modifiedAt`, `modifiedAt:asc`, `modifiedAt:desc`, `name`, `name:asc`, `name:desc`
- `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 Molecule. Restricts results to those with the specified name, alias, or entity registry ID.
- `nameIncludes` (string, optional) — Name substring of a Molecule. Restricts results to those with names, aliases, or entity registry IDs that include the provided substring.
- `folderId` (string, optional) — ID of a folder. Restricts results to those in the folder.
- `mentionedIn` (list of string, optional) — Comma-separated list of entry IDs. Restricts results to Molecules mentioned in those entries.
- `projectId` (string, optional) — ID of a project. Restricts results to those in the project.
- `registryId` (string, optional) — ID of a registry. Restricts results to those registered in this registry. Specifying "null" returns unregistered items.
- `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.
- `archiveReason` (string, optional) — Archive reason. Restricts results to those with the specified archive reason. Use "NOT_ARCHIVED" to filter for unarchived Molecules. Use "ANY_ARCHIVED" to filter for archived Molecules regardless of reason. Use "ANY_ARCHIVED_OR_NOT_ARCHIVED" to return items for both archived and unarchived.
- `mentions` (list of string, optional) — Comma-separated list of item IDs. Restricts results to those that mention the given items in the description.
- `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.
- `entityRegistryIds.anyOf` (string, optional) — Comma-separated list of entity registry IDs. Maximum of 100. Restricts results to those that match any of the specified registry IDs.
- `names.anyOf` (string, optional) — Comma-separated list of names. Maximum of 100. Restricts results to those that match any of the specified names, aliases, or entity registry IDs.
- `authorIds.anyOf` (string, optional) — Comma separated list of user or app IDs. Maximum of 100.
- `chemicalSubstructure.mol` (string, optional) — mol-formatted string for a chemical substructure to search by
- `chemicalSubstructure.smiles` (string, optional) — SMILES string for a chemical substructure to search by

## Response

### 200

OK

- `molecules` (list of Molecule, optional)
- `nextToken` (string, optional)

## Errors

### 400 Bad Request Error

Bad request

- `error` (BadRequestErrorError, optional)

## Types

### Molecule

- `aliases` (list of string, optional) — Array of aliases.
- `apiURL` (string, optional) — The canonical url of the Molecule in the API.
- `archiveRecord` (ArchiveRecord, optional, nullable)
- `authors` (list of UserSummary, optional)
- `canonicalizedSmiles` (string, optional) — The canonicalized chemical structure in SMILES format.
- `createdAt` (datetime, optional) — DateTime the Molecule was created.
- `creator` (UserSummary, optional)
- `customFields` (map from string to CustomField, optional) — Custom fields set on the Molecule.
- `entityRegistryId` (string, optional, nullable) — Registry ID of the Molecule if registered.
- `fields` (map from string to Field, optional)
- `folderId` (string, optional, nullable) — ID of the folder that contains the Molecule.
- `id` (string, optional) — ID of the Molecule.
- `modifiedAt` (datetime, optional) — DateTime the Molecule was last modified.
- `name` (string, optional) — Name of the Molecule.
- `originalSmiles` (string, optional, nullable) — The original chemical structure supplied by the user in SMILES format. Null if the user did not originally supply SMILES.
- `registrationOrigin` (RegistrationOrigin, optional, nullable)
- `registryId` (string, optional, nullable) — Registry the Molecule is registered in.
- `schema` (SchemaSummary, optional, nullable)
- `webURL` (string, optional) — URL of the Molecule.

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

### CustomField

- `value` (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`

### RegistrationOrigin

- `originEntryId` (string, optional, nullable)
- `registeredAt` (datetime, optional)

### 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
{
  "molecules": [
    {
      "aliases": [
        "string"
      ],
      "apiURL": "string",
      "archiveRecord": {
        "reason": "Made in error"
      },
      "authors": [
        {
          "handle": "string",
          "id": "string",
          "name": "string"
        }
      ],
      "canonicalizedSmiles": "Nc1nc(=O)n([H])cc1C1CC1",
      "createdAt": "2024-01-15T09:30:00Z",
      "creator": {
        "handle": "string",
        "id": "string",
        "name": "string"
      },
      "customFields": {},
      "entityRegistryId": "string",
      "fields": {},
      "folderId": "string",
      "id": "mol_bhuDUw9D",
      "modifiedAt": "2024-01-15T09:30:00Z",
      "name": "string",
      "originalSmiles": "Nc1nc(=O)n([H])cc1C1CC1",
      "registrationOrigin": {
        "originEntryId": "string",
        "registeredAt": "2024-01-15T09:30:00Z"
      },
      "registryId": "string",
      "schema": {
        "id": "string",
        "name": "string"
      },
      "webURL": "https://benchling.com/benchling/f/lib_R8KcsjhW-molecules/mol_xCUXNVyG-molecule1/edit"
    }
  ],
  "nextToken": "string"
}
```

**SDK Code**

```python
import requests

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

querystring = {"archiveReason":"ANY_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/molecules?archiveReason=ANY_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);
}
```