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

# Create a monomer

POST https://{tenant_name}.benchling.com/api/v2/monomers
Content-Type: application/json

Create a monomer.

Reference: https://docs.benchling.com/docs/api/v2/benchling-api/monomers/create-monomer

## Authentication

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

## Request

### Query parameters

- `returning` (string, optional) — Comma-separated list of fields to return. Modifies the output shape. To return all keys at a given level, enumerate them or use the wildcard, '*'. For more information, [click here](https://docs.benchling.com/docs/getting-started-1#returning-query-parameter).

### Body (application/json)

This endpoint expects a MonomerCreate.

- `color` (string, optional, nullable) — The hex color code of the monomer visual symbol
- `customMolecularWeight` (double, optional, nullable) — Optional molecular weight value that the user can provide to override the calculated molecular weight
- `name` (string, optional) — Name of the monomer
- `naturalAnalog` (string, optional) — Symbol for the natural equivalent of the monomer. Acceptable natural analog values include IUPAC bases, r, and p.
- `smiles` (string, optional) — The chemical structure in SMILES format.
- `symbol` (string, optional) — User-defined identifier of the monomer, unique on the monomer type.
- `visualSymbol` (enum, optional) — The shape of the monomer visual symbol.
  - Allowed values: `DIAMOND_FILLED`, `DIAMOND_HOLLOW`, `DIAMOND_DASHED`, `STAR_FILLED`, `STAR_HOLLOW`, `TRIANGLE_FILLED`, `TRIANGLE_HOLLOW`, `DYAD_FILLED`, `DYAD_HOLLOW`, `CLOVER_FILLED`, `CLOVER_HOLLOW`, `TRIAD_FILLED`, `TRIAD_HOLLOW`, `RECTANGLE_FILLED`, `RECTANGLE_HOLLOW`, `LETTERS_P`, `LETTERS_PS`

## Response

### 201

Created

- `archiveRecord` (ArchiveRecord, optional, nullable)
- `attachmentPoints` (list of string, optional) — A list of the capping group present at each location where the monomer can form a bond with other monomers
- `calculatedMolecularWeight` (double, optional) — The molecular weight of the monomer as calculated by RDKit based on the monomer chemical structure
- `canonicalSmiles` (string, optional) — The canonicalized chemical structure in SMILES format.
- `createdAt` (datetime, optional) — DateTime the monomer was created.
- `customMolecularWeight` (double, optional, nullable) — Optional molecular weight value that the user can provide to override the calculated molecular weight
- `exactMolecularWeight` (double, optional) — The exact molecular weight of the monomer as calculated by RDKit based on the monomer chemical structure
- `id` (string, optional) — ID of the monomer
- `modifiedAt` (datetime, optional) — DateTime the monomer was last modified.
- `monomerType` (enum, optional) — The part of the nucleotide structure that the monomer fits into, i.e. backbone or branch
  - Allowed values: `BACKBONE`, `BRANCH`
- `name` (string, optional) — Name of the monomer
- `naturalAnalog` (string, optional) — Symbol for the natural equivalent of the monomer. Acceptable natural analog values include IUPAC bases, r, and p.
- `originalSmiles` (string, optional, nullable) — The original chemical structure supplied by the user in SMILES format. Null if the user did not originally supply SMILES.
- `polymerType` (enum, optional) — The polymer type of the monomer. Currently only RNA monomers are supported.
  - Allowed values: `RNA`
- `symbol` (string, optional) — User-defined identifier of the monomer, unique on the monomer type.
- `visualColor` (string, optional, nullable) — The hex color code of the monomer visual symbol
- `visualSymbol` (enum, optional, nullable) — The shape of the monomer visual symbol.
  - Allowed values: `DIAMOND_FILLED`, `DIAMOND_HOLLOW`, `DIAMOND_DASHED`, `STAR_FILLED`, `STAR_HOLLOW`, `TRIANGLE_FILLED`, `TRIANGLE_HOLLOW`, `DYAD_FILLED`, `DYAD_HOLLOW`, `CLOVER_FILLED`, `CLOVER_HOLLOW`, `TRIAD_FILLED`, `TRIAD_HOLLOW`, `RECTANGLE_FILLED`, `RECTANGLE_HOLLOW`, `LETTERS_P`, `LETTERS_PS`

## Errors

### 400 Bad Request Error

Bad Request

- `error` (BadRequestErrorError, optional)

### 403 Forbidden Error

Forbidden

- `error` (ForbiddenErrorError, optional)

## Types

### ArchiveRecord

- `reason` (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)

## Examples

**Request**

```json
{
  "name": "(Rp)-Phosphorothioate",
  "naturalAnalog": "T",
  "smiles": "O[P@@](=S)([OH:1])[OH:2]",
  "symbol": "Rsp"
}
```

**Response**

```json
{
  "archiveRecord": {
    "reason": "Made in error"
  },
  "attachmentPoints": [
    "OH",
    "OH"
  ],
  "calculatedMolecularWeight": 120.422,
  "canonicalSmiles": "O[P@@](=S)([OH:1])[OH:2]",
  "createdAt": "2024-01-15T09:30:00Z",
  "customMolecularWeight": 119.422,
  "exactMolecularWeight": 119.422,
  "id": "mon_bhuDUw9D",
  "modifiedAt": "2024-01-15T09:30:00Z",
  "monomerType": "BACKBONE",
  "name": "(Rp)-Phosphorothioate",
  "naturalAnalog": "T",
  "originalSmiles": "O[P@@](=S)([OH:1])[OH:2]",
  "polymerType": "RNA",
  "symbol": "Rsp",
  "visualColor": "#7051FC",
  "visualSymbol": "DIAMOND_FILLED"
}
```

**SDK Code**

```python
import requests

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

payload = {
    "name": "(Rp)-Phosphorothioate",
    "naturalAnalog": "T",
    "smiles": "O[P@@](=S)([OH:1])[OH:2]",
    "symbol": "Rsp"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://{tenant_name}.benchling.com/api/v2/monomers';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"(Rp)-Phosphorothioate","naturalAnalog":"T","smiles":"O[P@@](=S)([OH:1])[OH:2]","symbol":"Rsp"}'
};

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