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

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

Create a data frame.

Data frames can be created from `.csv` files, and only 1 `.csv` file can currently be uploaded.

A successful data frame upload requires 3 calls in serial:

1. [Create a data frame](#/Data%20Frames/createDataFrame), this endpoint, specifying the files to upload. This
   returns a `manifest` containing S3 `PUT` URLs corresponding to the files that will be uploaded for
   the 2nd call and a data frame ID for the 3rd call.
2. Upload the data frame `.csv` content to S3. Add `x-amz-server-side-encryption: AES256` to the request
   headers, because we use server-side encryption. Here is a `curl` example:
   ```bash
   curl -H "x-amz-server-side-encryption: AES256" -X PUT -T <LOCAL_FILE> -L <S3_PUT_URL>
   ```
3. [Update the data frame](#/Data%20Frames/patchDataFrame) to mark as `IN_PROGRESS` to start a [long-running task](#/Tasks/getTask)
   to process and validate the data frame.
   * For more details on how we process and validate data frames, [click here](https://docs.benchling.com/docs/datasets-ingestion-reference).

Note: Manifest URLs are valid for 1 hour after being returned from this endpoint. They should not be stored
persistently for later use.

CSV files up to 150MB are supported.

Reference: https://docs.benchling.com/docs/api/v2-beta/benchling-api-beta/data-frames/create-data-frame

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

- `manifest` (list of DataFrameCreateManifestItems, required)
- `name` (string, required)

## Response

### 200

OK

- `errorMessage` (string, optional, nullable)
- `uploadStatus` (enum, optional)
  - Allowed values: `IN_PROGRESS`, `SUCCEEDED`, `FAILED_VALIDATION`, `NOT_UPLOADED`
- `manifest` (list of DataFrameManifestItems, optional)
- `columns` (list of DataFrameColumnMetadata, optional)
- `id` (string, optional)
- `name` (string, optional) — The user-facing name for this DataFrame.

## Errors

### 400 Bad Request Error

Bad Request

- `error` (BadRequestErrorError, optional)

### 403 Forbidden Error

Forbidden

- `error` (ForbiddenErrorError, optional)

### 404 Not Found Error

Not Found

- `error` (NotFoundErrorError, optional)

## Types

### DataFrameCreateManifestItems

List of files that will be uploaded to a data frame and their names.

- `fileName` (string, optional)

### DataFrameManifestItems

List of files composing a data frane, their names, and their corresponding URLs.

- `fileName` (string, optional)
- `url` (string, optional, nullable)

### DataFrameColumnMetadata

- `displayName` (string, optional)
- `type` (DataFrameColumnTypeMetadata, 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)

### NotFoundErrorError

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

### DataFrameColumnTypeMetadata

- `isList` (boolean, required)
- `isNullable` (boolean, required)
- `name` (enum, optional)
  - Allowed values: `String`, `Int`, `Float`, `JSON`, `DateTime`, `Date`, `Boolean`, `ObjectLink`
- `target` (DataFrameColumnTypeMetadataTarget, optional) — Only present if the column type is ObjectLink

### DataFrameColumnTypeMetadataTarget

Only present if the column type is ObjectLink

- `baseTypeName` (string, optional)
- `schemaId` (string, optional, nullable)

## Examples

**Request**

```json
{
  "manifest": [
    {
      "fileName": "09-14-2022_011620_PM_well_plate-part-00000.csv"
    }
  ],
  "name": "09-14-2022 01:16:20 PM well plate"
}
```

**Response**

```json
{
  "errorMessage": null,
  "uploadStatus": "NOT_UPLOADED",
  "manifest": [
    {
      "fileName": "09-14-2022_011620_PM_well_plate-part-00000.csv",
      "url": "https://benchling-location.s3.amazonaws.com/deploys/location/data_frames/source_files/.../09-14-2022_011620_PM_well_plate-part-00000.csv?..."
    }
  ],
  "id": "dset_LlDFupKyErxx",
  "name": "09-14-2022 01:16:20 PM well plate"
}
```

**SDK Code**

```python Data Frames_createDataFrame_example
import requests

url = "https://{tenant_name}.benchling.com/api/v2-beta/data-frames"

payload = {
    "manifest": [{ "fileName": "09-14-2022_011620_PM_well_plate-part-00000.csv" }],
    "name": "09-14-2022 01:16:20 PM well plate"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Data Frames_createDataFrame_example
const url = 'https://{tenant_name}.benchling.com/api/v2-beta/data-frames';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"manifest":[{"fileName":"09-14-2022_011620_PM_well_plate-part-00000.csv"}],"name":"09-14-2022 01:16:20 PM well plate"}'
};

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