POST /v2/evals/datasets/{dataset_id}/imports
Import finished runs atomically, requiring evals.update and analytics.read.
Inputs and expected outputs come from each run trace under the dataset contract. A run without a usable trace rejects the whole batch; Location is the first row.
How to use
Import 1–100 finished run IDs from the dataset project. Requires both evals.update and analytics.read. The whole batch is rejected if a trace is unusable; correct the identified runs before resubmission.
Authentication and permissions
Required permissions: evals.update, analytics.read. Resource and owner access checks also apply.
Prepare request.json
Save the example body below as request.json for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.
{
"run_ids": [
"00000000-0000-4000-8000-000000000001"
]
}Personal API key (sk_...) or supported user access JWT. See Authentication and authorization for endpoint restrictions and scopes. Use exactly one Authorization header.
Finished runs of the dataset's project to import as rows: inputs and expected output are extracted from each run trace under the dataset contract and source_run_id is set. Any run without a usable trace rejects the whole batch with a 422 naming it. Requires evals.update and analytics.read.
Successful Response
Invalid request or pagination cursor
Missing or invalid credentials
Denied permission, project folder access, or API-key scope (meta.required_scope)
Resource not found in the caller's organization
Name conflict, concurrent operation, or dataset state prevents the operation
Invalid evaluation contract, row shape, evaluator configuration, or filter combination
Client error returned in the public API envelope
curl --fail-with-body -sS \
"$STACKAI_BASE_URL/v2/evals/datasets/${DATASET_ID}/imports" \
-H "Authorization: Bearer $STACKAI_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @request.json{
"response_code": "text",
"meta": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"data": [
{
"dataset_row_id": "123e4567-e89b-12d3-a456-426614174000",
"dataset_id": "123e4567-e89b-12d3-a456-426614174000",
"url": "text",
"position": 1,
"inputs": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"expected_output": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"source_run_id": "123e4567-e89b-12d3-a456-426614174000",
"created_by": "123e4567-e89b-12d3-a456-426614174000",
"updated_by": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}
]
}Last updated
Was this helpful?

