# Create dataset items from JSON file

**POST** `/v1/private/datasets/items/from-json`

Create dataset items from an uploaded JSON or JSONL file. JSON files must contain a top-level array of objects.
JSONL files contain one JSON object per non-blank line; multi-line JSON objects are not supported.
Reserved keys (id, source, description, tags, evaluators, execution_policy) are extracted into the
corresponding DatasetItem fields; all remaining keys form the item's data map and preserve their JSON types.
To link dataset items to specific traces or spans use the dedicated /items/from-traces or /items/from-spans endpoints.
Processing happens asynchronously in batches. With dataset versioning enabled, a supplied id acts as an upsert key.

Base URL: `https://www.comet.com/opik/api`

Tags: `Datasets`

## Authorization

This operation requires no authorization.

## Request body

Optional. Media type: `multipart/form-data`

### Example request body

```json
{
  "dataset_id": "00000000-0000-0000-0000-000000000000",
  "file": {},
  "format": "json"
}
```

## Responses

| Status | Description | Media type |
| --- | --- | --- |
| `202` | Accepted - JSON processing started | — |
| `400` | Bad Request | `application/json` |

### Example response: 400 — Bad Request

```json
{
  "code": 0,
  "details": "string",
  "message": "string"
}
```

## Related pages

- [Activate a pairing session](./activatepairingsession.md)
- [Add blueprint to existing config](./updateagentconfig.md)
- [Add items to annotation queue](./additemstoannotationqueue.md)
- [Add span comment](./addspancomment.md)
- [Add span feedback score](./addspanfeedbackscore.md)
- [Add thread comment](./addthreadcomment.md)
- [Add trace comment](./addtracecomment.md)
- [Add trace feedback score](./addtracefeedbackscore.md)
- [Agent Configs](./tags/agent-configs.md)
- [Agent Insights](./tags/agent-insights.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
