curl --request POST \
--url https://api.promptlayer.com/api/public/v2/dataset-versions/add-trace \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"dataset_group_id": 123,
"trace_id": "abc123def456"
}
'{
"success": true,
"draft_dataset_id": 789,
"mode": "trace"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Datasets API
Add Trace to Dataset
POST
/
api
/
public
/
v2
/
dataset-versions
/
add-trace
curl --request POST \
--url https://api.promptlayer.com/api/public/v2/dataset-versions/add-trace \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"dataset_group_id": 123,
"trace_id": "abc123def456"
}
'{
"success": true,
"draft_dataset_id": 789,
"mode": "trace"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Legacy Dataset, Evaluation, and Report endpoints are deprecated for new workflows. Use the Tables API for new dataset import, evaluation, scoring, recalculation, and reporting workflows.
Behavior Notes
- If no draft dataset version exists for the group, one is automatically created and seeded from the most recent published version’s rows.
- The trace and dataset group must belong to the same workspace.
- Use
span_idto export a specific span subtree instead of the full trace root. - The
modefield in the response indicates whether the row was created intracemode (root anchor) orspanmode (chosen anchor).
Related
Body
application/json
Was this page helpful?

