Working with Molecules
Molecules are GA, so no header is needed. For how Compounds, Forms, and counterparts relate, see the concept model.
Higher-volume create and update variants are covered in Choosing a create endpoint.
The structure
Every molecule carries a chemicalStructure on input:
structureFormat:smilesormolfile.value: the structure itself. An empty SMILES creates a structureless molecule (a valid, named placeholder with no structure).
On read, the molecule reports three SMILES fields. The request’s chemicalStructure is not echoed back.
Creating a molecule
name, chemicalStructure, and folderId are required. schemaId and schemaFields are optional; see Working with Molecule Schemas for discovering these.
Registering a molecule
Registration is controlled by three fields on create or update:
registryIdis the on/off switch. When present, the molecule is registered into that registry. Setting it tonullon update unregisters the molecule.- Plus exactly one of:
namingStrategy: how Benchling assigns the registry ID and name (for example,NEW_IDSto auto-generate a new ID and keep the name). See naming strategies for all of them.entityRegistryId: supply your own ID.
Providing both, or neither, is rejected.
Updating and archiving a molecule
To archive or restore a molecule, use the same update endpoint: PATCH /molecule/{molecule_id} with archived: true (optionally with an archiveReason) to archive, or archived: false to restore.
Why can’t I change a molecule’s structure?
If the molecule is linked to a reaction, editing its chemicalStructure returns a 400 (“linked to a reaction”). Editing its name or schema fields still works; only the structure edit is blocked. (Salt and solvent library structures are separately immutable after creation, by design.)
Choosing a create endpoint
There are four ways to create molecules. Pick by how many you’re creating, and by whether you want Benchling to auto-create the parent Compound for salt forms.
“Batch” here means an operation, not an entity. :batch-create is a synchronous multi-create. It is not related to a Batch/Lot, a physical sample of a registered entity, which isn’t exposed on the V3 API at all. Creating molecules with :batch-create never touches Batches.
On the standard endpoints, a Form is linked to its parent Compound only if you supply the Compound’s ID yourself (in schemaFields). Nothing is auto-resolved. :bulk-create-molecules-with-parent is the only endpoint that resolves the parent for you: it finds a matching Compound by structure and reuses it, or creates one if none exists.
Using the bulk endpoints
Unlike :batch-create, the :bulk-* endpoints don’t take an inline array. You stage your rows as a file first. The Bulk Import API guide covers the flow in full.
:bulk-create itself is GA, but the scratch-file upload and the task-polling endpoints it depends on are beta. Send EARLY-ACCESS: true on steps 1 and 3.
- Build a JSONL payload: one
{"request_id": "...", "input_object": { ... }}per line, whereinput_objecthas the same fields as a single create and eachrequest_idis unique. Upload it withPOST /scratch-file:create-and-uploadand{ "filename": "molecules.jsonl", "contents": "<your JSONL>" }(inlinecontentsis UTF-8, up to 10 MiB). You get back ascrfile_...ID. - Call
POST /molecule:bulk-createwith the body{ "fileId": "scrfile_..." }. It returns202with ataskIdandpollingUri. - Poll
GET /tasks/bulk/{task_id}until it completes. Fetch the created IDs from.../successful-resultsand any failures from.../errors. Both are keyed by yourrequest_id.