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

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

List Oligos

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

## 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`
- `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 an Oligo. Restricts results to those with the specified name, alias, or entity registry ID.
- `bases` (string, optional) — Full bases of the oligo. Restricts results to those with the specified bases, case-insensitive, allowing for circular or reverse complement matches. Does not allow partial matching or loose matching via degenerate bases.
- `folderId` (string, optional) — ID of a folder. Restricts results to those in the folder.
- `mentionedIn` (string, optional) — Comma-separated list of entry IDs. Restricts results to Oligos 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 items to those with the specified archive reason. Use "NOT_ARCHIVED" to filter for unarchived Oligos. Use "ANY_ARCHIVED" to filter for archived Oligos regardless of reason. Use "ANY_ARCHIVED_OR_NOT_ARCHIVED" to return items for both archived and unarchived.
- `mentions` (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, case insensitive. Warning - this filter can be non-performant due to case insensitivity.
- `names.anyOf.caseSensitive` (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, case sensitive.
- `creatorIds` (string, optional) — Comma separated list of users IDs
- `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).

## Response

### 200

OK

- `nextToken` (string, optional)
- `oligos` (list of Oligo, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `error` (BadRequestErrorError, optional)

## Types

### Oligo

### BadRequestErrorError

- `message` (string, optional)
- `type` (enum, optional)
  - Allowed values: `invalid_request_error`
- `userMessage` (string, optional)

## Examples

**Response**

```json
{
  "nextToken": "string",
  "oligos": [
    {
      "aliases": [
        "string"
      ],
      "apiURL": "string",
      "archiveRecord": {
        "reason": "Made in error"
      },
      "authors": [
        {
          "handle": "string",
          "id": "string",
          "name": "string"
        }
      ],
      "bases": "ACTTTTT",
      "createdAt": "2024-01-15T09:30:00Z",
      "creator": {
        "handle": "string",
        "id": "string",
        "name": "string"
      },
      "customFields": {},
      "entityRegistryId": "string",
      "fields": {},
      "folderId": "string",
      "id": "seq_bhuDUw9D",
      "length": 1,
      "modifiedAt": "2024-01-15T09:30:00Z",
      "name": "string",
      "nucleotideType": "DNA",
      "registrationOrigin": {
        "originEntryId": "string",
        "registeredAt": "2024-01-15T09:30:00Z"
      },
      "registryId": "string",
      "schema": {
        "id": "string",
        "name": "string"
      },
      "webURL": "https://benchling.com/benchling/f/lib_hBHqKbzE-oligos/seq_bhuDUw9D-test-oligo-abc/edit"
    }
  ]
}
```

**SDK Code**

```python
import requests

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

querystring = {"archiveReason":"NOT_ARCHIVED","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/oligos?archiveReason=NOT_ARCHIVED&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);
}
```