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

POST https://{tenant_name}.benchling.com/api/v3/feature-library-item
Content-Type: application/json

Create FeatureLibraryItem.

Reference: https://docs.benchling.com/docs/api/benchling-api/feature-library-item/create

## Authentication

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

## Request

### Body (application/json)

This endpoint expects a CreateFeatureLibraryItemInput.

- `color` (string, required) — Must be a valid hex color string (for example, `#F58A5E`).
- `featureLibraryId` (string, required) — Feature library id to contain this feature. Each library supports at most 5,000 items.
- `matchType` (enum, required) — Determines how `pattern` is interpreted during auto-annotation (`NUCLEOTIDE` or `AA_SEQUENCE`). Required on create and cannot be changed on update.
  - Allowed values: `NUCLEOTIDE`, `AA_SEQUENCE`
- `name` (string, required) — Item names must be non-empty after trimming whitespace and at most 255 characters.
- `pattern` (string, required) — Patterns must be non-empty and valid for the item's `matchType`. Nucleotide patterns accept IUPAC bases plus wildcards (`#`, `<`, `>`, `()`). Amino acid patterns accept standard residues plus the same wildcard characters. Patterns are compared case-insensitively within a library, so two items cannot differ only by letter case.
- `featureType` (string, optional) — The type of the Feature Library Item, like gene, promoter, etc. Note: This is an arbitrary string, not an enum

## Response

### 201

Created

- `__typename` (string, optional)
- `color` (string, optional) — The color of the annotations generated by the Feature Library Item. Must be a valid hex string
- `createdAt` (string, optional) — DateTime the Feature Library Item was created
- `featureLibrary` (FeatureLibraryRef, optional) — The Feature Library the Feature Library Item belongs to
- `featureType` (string, optional, nullable) — The type of the Feature Library Item, like gene, promoter, etc. Note: This is an arbitrary string, not an enum
- `id` (string, optional)
- `matchType` (enum, optional) — The match type of the Feature Library Item. Used to determine how auto-annotate matches are made
  - Allowed values: `NUCLEOTIDE`, `AA_SEQUENCE`
- `modifiedAt` (string, optional) — DateTime the Feature Library Item was last modified
- `name` (string, optional) — The name of the Feature Library Item
- `pattern` (string, optional) — The pattern used for matching during auto-annotation

## Errors

### 400 Feature Library Item Create 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 Feature Library Item Create 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 Feature Library Item Create 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 Feature Library Item Create 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 Feature Library Item Create 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 Feature Library Item Create 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

### FeatureLibraryRef

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

### GeneralErrorDetail

### TooManyRequestsErrorBodyDetail

### InternalServerErrorBodyDetail

## Examples

**Request**

```json
{
  "color": "#F58A5E",
  "featureLibraryId": "featlib_cWYhFmxq",
  "matchType": "NUCLEOTIDE",
  "name": "T7 promoter",
  "pattern": "TAATACGACTCACTATAGGG",
  "featureType": "promoter"
}
```

**Response**

```json
{
  "__typename": "__typename",
  "color": "color",
  "createdAt": "createdAt",
  "featureLibrary": {
    "__typename": "__typename",
    "id": "id"
  },
  "featureType": "featureType",
  "id": "id",
  "matchType": "NUCLEOTIDE",
  "modifiedAt": "modifiedAt",
  "name": "name",
  "pattern": "pattern"
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v3/feature-library-item"

payload = {
    "color": "#F58A5E",
    "featureLibraryId": "featlib_cWYhFmxq",
    "matchType": "NUCLEOTIDE",
    "name": "T7 promoter",
    "pattern": "TAATACGACTCACTATAGGG",
    "featureType": "promoter"
}
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/v3/feature-library-item';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"color":"#F58A5E","featureLibraryId":"featlib_cWYhFmxq","matchType":"NUCLEOTIDE","name":"T7 promoter","pattern":"TAATACGACTCACTATAGGG","featureType":"promoter"}'
};

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