> 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 Legacy Request Tasks for a Legacy Request

POST https://{tenant_name}.benchling.com/api/v2/requests/{request_id}/tasks:bulk-create
Content-Type: application/json

Create Legacy Request Tasks for a Legacy Request

Reference: https://docs.benchling.com/docs/api/v2/benchling-api/legacy-requests/bulk-create-request-tasks

## Authentication

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

## Request

### Path parameters

- `request_id` (string, required)

### Body (application/json)

This endpoint expects a RequestTasksBulkCreateRequest.

- `tasks` (list of RequestTasksBulkCreate, required) — The Legacy Request Tasks to create

## Response

### 200

OK

- `tasks` (list of RequestTask, optional) — The created Legacy Request Tasks

## Errors

### 400 Bad Request Error

Bad Request

- `error` (BadRequestErrorBulkError, optional)

## Types

### RequestTasksBulkCreate

- `schemaId` (string, required) — The schema id of the Legacy Request Task to create
- `fields` (map from string to Field, optional) — Schema fields to set on the request task. Every field should have its name as a key, mapping to an object with information about the value of the field.
- `sampleGroupIds` (list of string, optional) — IDs of all Legacy Request Sample Groups now associated with this task.

### RequestTask

A request task.

- `id` (string, required) — ID of the Legacy Request Task
- `fields` (map from string to Field, optional) — Schema fields to set on the request task. Every field should have its name as a key, mapping to an object with information about the value of the field.
- `sampleGroupIds` (list of string, optional) — IDs of all Legacy Request Sample Groups now associated with this task.
- `schema` (SchemaSummary, optional, nullable)

### BadRequestErrorBulkError

- `errors` (list of BadRequestErrorBulkErrorErrorsItems, optional)
- `message` (string, optional)
- `type` (enum, optional)
  - Allowed values: `invalid_request_error`
- `userMessage` (string, optional)

### Field

- `value` (FieldValue, required, nullable) — For single link fields, use the id of the item you want to link (eg. "seq_jdf8BV24"). For multi-link fields, use an array of ids of the items you want to link (eg. ["seq_jdf8BV24"])
- `displayValue` (string, optional, nullable)
- `isMulti` (boolean, optional)
- `textValue` (string, optional, nullable)
- `type` (enum, optional)
  - Allowed values: `dna_sequence_link`, `aa_sequence_link`, `custom_entity_link`, `entity_link`, `mixture_link`, `molecule_link`, `dropdown`, `part_link`, `translation_link`, `aa_part_link`, `base_molecule_link`, `blob_link`, `text`, `long_text`, `batch_link`, `storage_link`, `entry_link`, `assay_request_link`, `assay_result_link`, `assay_run_link`, `boolean`, `float`, `integer`, `datetime`, `date`, `json`

### SchemaSummary

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

### BadRequestErrorBulkErrorErrorsItems

- `index` (double, optional)
- `message` (string, optional)

### FieldValue

For single link fields, use the id of the item you want to link (eg. "seq_jdf8BV24"). For multi-link fields, use an array of ids of the items you want to link (eg. ["seq_jdf8BV24"])

## Examples

**Request**

```json
{
  "tasks": [
    {
      "schemaId": "reqtsksch_XHu79QRw"
    }
  ]
}
```

**Response**

```json
{
  "tasks": [
    {
      "id": "reqtsk_PFHQ8rmb",
      "fields": {},
      "sampleGroupIds": [
        "string"
      ],
      "schema": {
        "id": "string",
        "name": "string"
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v2/requests/req_JekfeyVS/tasks:bulk-create"

payload = { "tasks": [{ "schemaId": "reqtsksch_XHu79QRw" }] }
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/requests/req_JekfeyVS/tasks:bulk-create';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"tasks":[{"schemaId":"reqtsksch_XHu79QRw"}]}'
};

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