Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Create dataset items from JSON file

POST/v1/private/datasets/items/from-jsonCreate dataset items from JSON file

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.

Request body

multipart/form-data
object
dataset_idstring · uuidrequired
fileobjectrequired
formatstringrequired

one of "json", "jsonl"

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

Responses

202Accepted - JSON processing started
400Bad Requestapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
Documentation menu