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

POST https://{tenant_name}.benchling.com/api/v3/data-frame
Content-Type: application/json

Create DataFrame.

Reference: https://docs.benchling.com/docs/api/benchling-api/data-frame/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 CreateDataFrameInput.

- `name` (string, required)
- `scratchFileId` (string, required, nullable) — ID of ScratchFile containing the raw file from which to create the DataFrame. Only files with a .csv or .tsv extension are supported.
- `delimiter` (string, optional) — Single-character delimiter used when parsing the file. Defaults to a tab for .tsv files and ',' otherwise.
- `locale` (string, optional) — Locale used for number parsing, such as decimal and thousands separators (e.g. 'en-US'). Defaults to 'en-US' if not specified.

## Response

### 201

Created

- `__typename` (string, optional)
- `columns` (list of DataFrameColumn, optional)
- `createdAt` (string, optional)
- `creator` (PrincipalRef, optional)
- `dataset` (DatasetRef, optional, nullable)
- `errorMessage` (string, optional, nullable)
- `id` (string, optional)
- `manifest` (list of DataFrameManifestItem, optional)
- `modifiedAt` (string, optional)
- `name` (string, optional)
- `size` (integer, optional)
- `uploadStatus` (enum, optional)
  - Allowed values: `SUCCEEDED`, `FAILED_VALIDATION`, `IN_PROGRESS`, `NOT_UPLOADED`

## Errors

### 400 Data Frame 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 Data Frame 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 Data Frame 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 Data Frame 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 Data Frame 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)

### 500 Data Frame 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

### DataFrameColumn

Defines a column within a DataFrame, including its internal system name, user-facing display name, and data type specification.

- `__typename` (string, optional)
- `displayName` (string, optional)
- `systemName` (string, optional)
- `type` (map from string to any, optional)

### PrincipalRef

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

### DatasetRef

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

### DataFrameManifestItem

Represents one part of a DataFrame's downloadable row data. Currently, the manifest always contains exactly one item. The array structure is forward-compatible with future multi-part download support for large data frames.

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

### GeneralErrorDetail

### TooManyRequestsErrorBodyDetail

### InternalServerErrorBodyDetail

## Examples

**Request**

```json
{
  "name": "name",
  "scratchFileId": null
}
```

**Response**

```json
{
  "__typename": "__typename",
  "columns": [
    {
      "__typename": "__typename",
      "displayName": "displayName",
      "systemName": "systemName",
      "type": {
        "key": "value"
      }
    }
  ],
  "createdAt": "createdAt",
  "creator": {
    "__typename": "__typename",
    "id": "id"
  },
  "dataset": {
    "__typename": "__typename",
    "id": "id"
  },
  "errorMessage": "errorMessage",
  "id": "id",
  "manifest": [
    {
      "__typename": "__typename",
      "fileName": "fileName",
      "url": "url"
    }
  ],
  "modifiedAt": "modifiedAt",
  "name": "name",
  "size": 1,
  "uploadStatus": "SUCCEEDED"
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v3/data-frame"

payload = {
    "name": "name",
    "scratchFileId": None
}
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/data-frame';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"name","scratchFileId":null}'
};

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