Skip to main content

Add a dataset item

POST 

/api/v1/evals/add-dataset-item

Adds a dataset item. The ID is derived from the dataset and sourceUserMessageId when supplied, otherwise from the source trace ID. Repeating that identity addresses the same item; a source identity must be meaningful and stable. Provide the intended input and expected output explicitly: the current API does not fetch a gold answer from a source trace.

Dataset input capture and identity​

Section ID: DOC-IS-evaluation-api-addDatasetItem#dataset-input-capture-and-identity

Input or identityContract
Dataset item addressDerived from the dataset and source turn. Adding the same turn to different datasets produces different items.
inputJson and expected outputOnly supplied content is recorded; an empty input does not trigger automatic context capture.
Retry or replacementA stable item ID does not establish ordering between a stale retry and a newer curated revision. Reconcile the stored item before retrying.

Capture and curate source material explicitly, including redaction, omitted fields and the provenance of tool or memory fixtures.

The following access conditions are preserved as declared intent and are not implemented by generated code: Authorized scoped domain action.

Use this in a guide: Replay datasets and runs · Dataset identity and run provenance

Request​

Responses​

OK

Harvest an existing trace into a named dataset; replace sourceTraceId with the trace being curated.​

Section ID: DOC-IS-evaluation-api-addDatasetItem#example-evals-addDatasetItem-request

Request example

{
"datasetId": "support-answers",
"sourceTraceId": "trace_123",
"inputJson": "{\"question\":\"How do I reset my password?\"}",
"expectedOutputJson": "\"Use the password reset link on the sign-in page.\""
}

Guide request for 2. Save the input needed to reproduce the problem. Replace example resource identifiers with your own authorized values.​

Section ID: DOC-IS-evaluation-api-addDatasetItem#example-cookbook-insights-evaluation-datasets-and-runs-02-request

Request example

{
"datasetId": "support-assistant-regressions",
"conversationId": "conv_123",
"sourceUserMessageId": "msg_abc",
"inputJson": "{\"question\":\"What is the return window?\"}"
}

Illustrative response shape; omitted default fields and actual outcomes depend on the operation.​

Section ID: DOC-IS-evaluation-api-addDatasetItem#example-evals-addDatasetItem-response

Response example

{
"itemId": "example_123"
}

Document ID: DOC-IS-evaluation-api-addDatasetItem. Section identities and revisions.

SectionStable reference
Add a dataset itemDOC-IS-evaluation-api-addDatasetItem#overview
RequestDOC-IS-evaluation-api-addDatasetItem#request
ResponsesDOC-IS-evaluation-api-addDatasetItem#responses