Skip to main content
POST
/
v1
/
dataset
/
{dataset_id}
/
insert
Insert dataset events
curl --request POST \
  --url https://api.braintrust.dev/v1/dataset/{dataset_id}/insert \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "events": [
    {
      "input": "<any>",
      "expected": "<any>",
      "metadata": {
        "model": "<string>"
      },
      "tags": [
        "<string>"
      ],
      "id": "<string>",
      "created": "2023-11-07T05:31:56Z",
      "origin": {
        "object_type": "project_logs",
        "object_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "id": "<string>",
        "_xact_id": "<string>",
        "created": "<string>"
      },
      "_object_delete": true,
      "_is_merge": true,
      "_merge_paths": [
        [
          "<string>"
        ]
      ],
      "_parent_id": "<string>",
      "span_id": "<string>",
      "root_span_id": "<string>",
      "span_parents": [
        "<string>"
      ]
    }
  ]
}'
{
  "row_ids": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key] to your HTTP request. You can create an API key in the Braintrust organization settings page.

Path Parameters

dataset_id
string<uuid>
required

Dataset id

Body

application/json

An array of dataset events to insert

events
object[]
required

A list of dataset events to insert

Response

Returns the inserted row ids

row_ids
string[]
required

The ids of all rows that were inserted, aligning one-to-one with the rows provided as input