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

PATCH https://{tenant_name}.benchling.com/api/v3/molecule-schema/{molecule_schema_id}
Content-Type: application/json

Update MoleculeSchema.

Reference: https://docs.benchling.com/docs/api/benchling-api/molecule-schema/update

## Authentication

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

## Request

### Path parameters

- `molecule_schema_id` (string, required) — ID of the MoleculeSchema.

### Body (application/json)

This endpoint expects an object.

- `archiveReason` (string, optional)
- `archived` (boolean, optional)
- `availableRegistrationNamingOptions` (list of enum, optional)
  - Allowed values: `NEW_IDS`, `IDS_FROM_NAMES`, `DELETE_NAMES`, `SET_FROM_NAME_PARTS`, `REPLACE_NAMES_FROM_PARTS`, `KEEP_NAMES`, `REPLACE_ID_AND_NAME_FROM_PARTS`
- `constraint` (CreateMoleculeSchemaConstraintInput, optional, nullable)
- `containerNameTemplate` (ContainerNameTemplateInput, optional, nullable) — Replaces all existing container name template parts. Legacy datetimeFormat configurations are not preserved.
- `description` (string, optional) — Updated description. When provided, must be at most 1000 characters.
- `iconId` (enum, optional)
  - Allowed values: `BASIC_FOLDER_ITEM`, `SMALL_MOLECULE`, `SMALL_MOLECULE_BEAKER`
- `includeRegistryIdInChips` (boolean, optional)
- `isContainable` (boolean, optional)
- `itemIdPrefix` (string, optional)
- `name` (string, optional) — Updated user-facing name. When provided, must be non-empty after stripping whitespace, at most 255 characters, and unique within the organization.
- `nameTemplate` (EntityNameTemplateInput, optional, nullable) — Replaces all existing entity name template parts. Legacy datetimeFormat configurations are not preserved. Updating the name template does not automatically modify availableRegistrationNamingOptions — update that field separately if needed.
- `systemCategories` (list of SystemCategoryConfigurationInputBase, optional)
- `systemName` (string, optional) — Updated SQL identifier for the warehouse table name. When provided, must match the pattern [a-z_][a-z0-9_$]*, cannot be a reserved table name, cannot start with 'bnch$', and must be unique within the organization.
- `useRegistryIdForItemDisplayLabel` (boolean, optional)
- `displayName` (string, optional, deprecated) — Deprecated. Use name instead.

## Response

### 200

OK

- `__typename` (string, optional)
- `archiveReason` (string, optional, nullable)
- `archived` (boolean, optional)
- `availableRegistrationNamingOptions` (list of enum, optional)
  - Allowed values: `NEW_IDS`, `IDS_FROM_NAMES`, `DELETE_NAMES`, `SET_FROM_NAME_PARTS`, `REPLACE_NAMES_FROM_PARTS`, `KEEP_NAMES`, `REPLACE_ID_AND_NAME_FROM_PARTS`
- `constraint` (Constraint, optional, nullable) — Defines uniqueness requirements for entities within a schema. Constraints ensure that registered entities have unique values across specified fields (see `fieldDefinitionNames`) or unique domain-specific properties (see `TypeSpecificConstraint`). The hasUniqueResidues field is a legacy indicator for sequence uniqueness.
- `containableType` (enum, optional)
  - Allowed values: `NONE`, `ENTITY`, `BATCH`
- `containerNameTemplate` (ContainerNameTemplate, optional, nullable) — A name template for containers.
- `createdAt` (string, optional, nullable)
- `description` (string, optional)
- `fieldDefinitions` (string, optional)
- `fieldsets` (string, optional)
- `iconId` (enum, optional)
  - Allowed values: `BASIC_FOLDER_ITEM`, `SMALL_MOLECULE`, `SMALL_MOLECULE_BEAKER`
- `id` (string, optional)
- `includeRegistryIdInChips` (boolean, optional)
- `itemIdPrefix` (string, optional)
- `modifiedAt` (string, optional)
- `name` (string, optional)
- `nameTemplate` (EntityNameTemplate, optional, nullable) — A name template for entities.
- `organization` (OrganizationRef, optional)
- `systemCategories` (list of SystemCategoryConfiguration, optional)
- `systemName` (string, optional)
- `useRegistryIdForItemDisplayLabel` (boolean, optional)
- `validationRules` (string, optional)

## Errors

### 400 Molecule Schema Update Request Bad Request Error

Bad Request

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 403 Molecule Schema Update Request Forbidden Error

Forbidden

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 404 Molecule Schema Update Request Not Found Error

Not Found

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 409 Molecule Schema Update Request Conflict Error

Conflict

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 429 Molecule Schema Update Request Too Many Requests Error

Too Many Requests

- `detail` (TooManyRequestsErrorBodyDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)
- `violated-policies` (list of enum, optional) — The budget policies that rejected the request, in canonical order: `user`, `integration`, then `tenant`.
  - Allowed values: `user`, `integration`, `tenant`

### 500 Molecule Schema Update Request Internal Server Error

Internal Server Error

- `detail` (InternalServerErrorBodyDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `errorId` (string, optional)

## Types

### CreateMoleculeSchemaConstraintInput

- `fieldDefinitionNames` (list of string, optional)
- `hasUniqueCanonicalSmiles` (boolean, optional)

### ContainerNameTemplateInput

- `nameTemplateParts` (list of ContainerNameTemplatePartInput, required)

### EntityNameTemplateInput

- `nameTemplateParts` (list of EntityNameTemplatePartInput, required)
- `shouldOrderPartsBySequence` (boolean, required)

### SystemCategoryConfigurationInputBase

- `systemCategoryId` (enum, required)
  - Allowed values: `ssi_aachain`, `ssi_aadomain`, `ssi_aapair`, `ssi_aasubelement`, `ssi_antigen`, `ssi_dnachain`, `ssi_dnadomain`, `ssi_dnapair`, `ssi_dnasubelement`, `ssi_expirationtracking`, `ssi_freezethawtracking`
- `limit` (integer, optional)

### Constraint

Defines uniqueness requirements for entities within a schema. Constraints ensure that registered entities have unique values across specified fields (see `fieldDefinitionNames`) or unique domain-specific properties (see `TypeSpecificConstraint`). The hasUniqueResidues field is a legacy indicator for sequence uniqueness.

- `__typename` (string, optional)
- `fieldDefinitionNames` (list of string, optional, nullable)
- `hasUniqueResidues` (boolean, optional, nullable)

### ContainerNameTemplate

A name template for containers.

- `__typename` (string, optional)
- `parts` (list of ContainerNameTemplatePart, optional)

### EntityNameTemplate

A name template for entities.

- `__typename` (string, optional)
- `parts` (list of EntityNameTemplatePart, optional)
- `shouldOrderPartsBySequence` (boolean, optional)

### OrganizationRef

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

### SystemCategoryConfiguration

### GeneralErrorDetail

### TooManyRequestsErrorBodyDetail

### InternalServerErrorBodyDetail

### ContainerNameTemplatePartInput

- `type` (enum, required)
  - Allowed values: `BARCODE`, `BARCODE_NUMBER`, `CHILD_ENTITY_LOT_NUMBER`, `CONCENTRATION_UNITS`, `CONCENTRATION_VALUE`, `CONTAINED_ENTITY_NAME`, `FIELD`, `FILL_DATE`, `FILL_YEAR`, `LINKED_BIOENTITY_REGISTRY_IDENTIFIER`, `PARENT_STORABLE_BARCODE`, `PARENT_STORABLE_NAME`, `POSITION`, `PROJECT`, `QUANTITY_UNITS`, `QUANTITY_VALUE`, `REGISTRY_IDENTIFIER_NUMBER`, `RESTRICTION_STATUS`, `SAMPLE_LOT_NUMBER`, `SEPARATOR`, `TEXT`
- `configuration` (ContainerNameTemplatePartInputConfiguration, optional)

### EntityNameTemplatePartInput

- `type` (enum, required)
  - Allowed values: `CHILD_ENTITY_LOT_NUMBER`, `COMPLEX_POLYMER_COMPONENT`, `CREATED_AT_DATE`, `CREATED_AT_YEAR`, `FIELD`, `LINKED_BIOENTITY_REGISTRY_IDENTIFIER`, `PROJECT`, `PROTEIN_CHAIN`, `PROTEIN_DOMAIN`, `REGISTRY_IDENTIFIER_NUMBER`, `SALT_CODES`, `SEPARATOR`, `TEXT`
- `configuration` (EntityNameTemplatePartInputConfiguration, optional)

### ContainerNameTemplatePart

A part in a container name template.

- `__typename` (string, optional)
- `configuration` (ContainerNameTemplatePartConfiguration, optional, nullable) — Union of TextNameTemplatePartConfiguration, FieldNameTemplatePartConfiguration
- `type` (enum, optional)
  - Allowed values: `BARCODE`, `BARCODE_NUMBER`, `CHILD_ENTITY_LOT_NUMBER`, `CONCENTRATION_UNITS`, `CONCENTRATION_VALUE`, `CONTAINED_ENTITY_NAME`, `CONTAINER_CREATED_AT_DATE`, `CONTAINER_CREATED_AT_YEAR`, `FIELD`, `FILL_DATE`, `FILL_YEAR`, `HOISTED_FIELD`, `LINKED_BIOENTITY_REGISTRY_IDENTIFIER`, `PARENT_STORABLE_BARCODE`, `PARENT_STORABLE_NAME`, `POSITION`, `PROJECT`, `QUANTITY_UNITS`, `QUANTITY_VALUE`, `REGISTRY_IDENTIFIER_NUMBER`, `REGISTRY_IDENTIFIER_NUMBER_BASE_26`, `RESTRICTION_STATUS`, `SAMPLE_LOT_NUMBER`, `SEPARATOR`, `TEXT`

### EntityNameTemplatePart

A part in an entity name template.

- `__typename` (string, optional)
- `configuration` (EntityNameTemplatePartConfiguration, optional, nullable) — Union of TextNameTemplatePartConfiguration, FieldNameTemplatePartConfiguration, ProteinChainNameTemplatePartConfiguration, ProteinDomainNameTemplatePartConfiguration
- `type` (enum, optional)
  - Allowed values: `CHILD_ENTITY_LOT_NUMBER`, `COMPLEX_POLYMER_COMPONENT`, `CREATED_AT_DATE`, `CREATED_AT_YEAR`, `FIELD`, `HOISTED_FIELD`, `LINKED_BIOENTITY_REGISTRY_IDENTIFIER`, `PROJECT`, `PROTEIN_CHAIN`, `PROTEIN_DOMAIN`, `REGISTRY_IDENTIFIER_NUMBER`, `REGISTRY_IDENTIFIER_NUMBER_BASE_26`, `SALT_CODES`, `SEPARATOR`, `TEXT`

### BaseSystemCategoryConfiguration

Default configuration for system categories that require no additional configuration.

- `__typename` (string, optional)
- `systemCategory` (SystemCategoryRef, optional) — The system category that this configuration references.

### FreezeThawTrackingConfiguration

Configuration that can be set on entity schemas, which enables enabling freeze/thaw cycle tracking. When enabled, containers holding entities of the schema automatically display a "Freeze/thaw count" system field that tracks how many times the sample has been frozen and thawed. The optional limit field specifies the maximum number of freeze/thaw cycles permitted before the sample is considered unfit for use; exceeding this limit can trigger warnings in inventory workflows. Once enabled on a schema, freeze/thaw tracking cannot be disabled. This feature is commonly used for biologics, enzymes, and other temperature-sensitive samples where repeated freeze/thaw cycles can degrade sample quality.

- `__typename` (string, optional)
- `limit` (integer, optional, nullable) — Max number of freeze/thaw cycles a container containing an entity of this schema is permitted to undergo while still being considered fit for use.
- `systemCategory` (SystemCategoryRef, optional)

### ContainerNameTemplatePartInputConfiguration

### EntityNameTemplatePartInputConfiguration

### ContainerNameTemplatePartConfiguration

### EntityNameTemplatePartConfiguration

### SystemCategoryRef

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

### TextNameTemplatePartConfigurationInput

- `text` (string, required)

### FieldNameTemplatePartConfigurationInput

- `fieldId` (string, required)

### ProteinChainNameTemplatePartConfigurationInput

- `label` (string, required)

### ProteinDomainNameTemplatePartConfigurationInput

- `label` (string, required)

### TextNameTemplatePartConfiguration

Configuration for a literal text name template part.

- `__typename` (string, optional)
- `text` (string, optional)

### FieldNameTemplatePartConfiguration

Configuration for a schema field name template part.

- `__typename` (string, optional)
- `field` (SchemaFieldDefinitionRef, optional)

### ProteinChainNameTemplatePartConfiguration

Configuration for a protein chain name template part.

- `__typename` (string, optional)
- `proteinChain` (ProteinFormatChain, optional) — A chain in a protein format, representing the slot where a polypeptide chain can be used in an entity of this format. Chains are uniquely identified by their label in the format. Chains can have multiplicity, meaning there are multiple physical instances of the same chain in a protein of this format.

### ProteinDomainNameTemplatePartConfiguration

Configuration for a protein domain name template part.

- `__typename` (string, optional)
- `proteinDomain` (ProteinFormatDomain, optional) — A domain in a protein format, representing the slot where an amino acid sequence can be used in an entity of this format. Domains are uniquely identified by their label in the format.

### SchemaFieldDefinitionRef

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

### ProteinFormatChain

A chain in a protein format, representing the slot where a polypeptide chain can be used in an entity of this format. Chains are uniquely identified by their label in the format. Chains can have multiplicity, meaning there are multiple physical instances of the same chain in a protein of this format.

- `__typename` (string, optional)
- `chainPositions` (list of ProteinFormatChainPosition, optional) — A list of all the chain positions of this chain in the format.
- `domains` (list of ProteinFormatDomain, optional) — The domains that compose this chain.
- `label` (string, optional) — A human-readable label for the chain, such as 'Heavy' or 'Light 1'. Chains are labeled with an index only when multiple distinct chains of the same type exist. These labels are unique among distinct chains in a format.
- `type` (enum, optional) — The type of the chain.
  - Allowed values: `HEAVY`, `LIGHT`, `NONE`, `ALPHA`, `BETA`, `JOINING`

### ProteinFormatDomain

A domain in a protein format, representing the slot where an amino acid sequence can be used in an entity of this format. Domains are uniquely identified by their label in the format.

- `__typename` (string, optional)
- `domainPositions` (list of ProteinFormatDomainPosition, optional) — A list of all the domain positions of this domain in the format.
- `label` (string, optional) — A human-readable label for the domain, uniquely identifying the domain within the format.
- `optional` (boolean, optional) — Whether this domain is optional in the format. If true, entities of this format may not have this domain.
- `type` (enum, optional) — The type of the domain (e.g., VH, VL, CH1).
  - Allowed values: `VL`, `CL`, `VH`, `VHH`, `CH1`, `CH2`, `CH3`, `CH4`, `J`, `H`, `L`, `VA`, `CA`, `VB`, `CB`, `VG`, `CG`, `VD`, `CD`, `F`, `ELEMENT`

### ProteinFormatChainPosition

Defines each instance of a polypeptide chain within a `ProteinFormat`, specifying the chain type and its constituent domains. Each chain position has a unique ref identifier and lists the domain positions (see `ProteinFormatDomainPosition`) that compose it in order from N-terminus to C-terminus. For example, a heavy chain position might reference domain positions [VH, CH1, Hinge, CH2, CH3].

- `__typename` (string, optional)
- `domainPositions` (list of ProteinFormatDomainPosition, optional) — A list of all the domain positions that make up the chain position, in order
- `ref` (integer, optional) — A unique identifier for a physical component (chain or domain) in a protein format. This is used to form a HELM reference that is used in the protein's complex polymer structure.
- `type` (enum, optional) — Type of the chain.
  - Allowed values: `HEAVY`, `LIGHT`, `NONE`, `ALPHA`, `BETA`, `JOINING`

### ProteinFormatDomainPosition

Defines a domain position within a `ProteinFormat`, specifying the domain type and identity of each physical domain in the protein format. Each domain position has a unique ref identifier used to construct HELM notation for complex polymer structures. Domain positions are grouped into ProteinFormatDomains, and each group can be uniquely identified by its label, and will be a single amino acid sequence entity in proteins of this format.

- `__typename` (string, optional)
- `optional` (boolean, optional) — Whether this domain is optional in the format. If true, entities of this format may not have this domain.
- `ref` (integer, optional) — A unique identifier for a physical component (chain or domain) in a protein format. This is used to form a HELM reference that is used in the protein's complex polymer structure.
- `type` (enum, optional) — Type of the domain
  - Allowed values: `VL`, `CL`, `VH`, `VHH`, `CH1`, `CH2`, `CH3`, `CH4`, `J`, `H`, `L`, `VA`, `CA`, `VB`, `CB`, `VG`, `CG`, `VD`, `CD`, `F`, `ELEMENT`

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "__typename": "__typename",
  "archiveReason": "archiveReason",
  "archived": true,
  "availableRegistrationNamingOptions": [
    "NEW_IDS"
  ],
  "constraint": {
    "__typename": "__typename",
    "fieldDefinitionNames": [
      "fieldDefinitionNames"
    ],
    "hasUniqueResidues": true
  },
  "containableType": "NONE",
  "containerNameTemplate": {
    "__typename": "__typename",
    "parts": [
      {}
    ]
  },
  "createdAt": "createdAt",
  "description": "description",
  "fieldDefinitions": "fieldDefinitions",
  "fieldsets": "fieldsets",
  "iconId": "BASIC_FOLDER_ITEM",
  "id": "id",
  "includeRegistryIdInChips": true,
  "itemIdPrefix": "itemIdPrefix",
  "modifiedAt": "modifiedAt",
  "name": "name",
  "nameTemplate": {
    "__typename": "__typename",
    "parts": [
      {}
    ],
    "shouldOrderPartsBySequence": true
  },
  "organization": {
    "__typename": "__typename",
    "id": "id"
  },
  "systemCategories": [
    {
      "__typename": "__typename"
    }
  ],
  "systemName": "systemName",
  "useRegistryIdForItemDisplayLabel": true,
  "validationRules": "validationRules"
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v3/molecule-schema/molecule_schema_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/v3/molecule-schema/molecule_schema_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);
}
```