---
title: "POST /api/v1/traces/{id}/addToDataset"
method: POST
path: "/api/v1/traces/{id}/addToDataset"
tags: ["Traces"]
---

# POST /api/v1/traces/{id}/addToDataset

`POST /api/v1/traces/{id}/addToDataset`

Add a trace to its linked project dataset as a datapoint or queue an improvement task

## Path parameters

- `id` string, uuid, required

## Response `200`

success response

- TracePromotionResponse
  - `traceId` string, uuid, required — Trace identifier that was processed.
  - `status` 'added' | 'queued' | 'failed', required — added when the datapoint is stored immediately, queued when generation is in progress, failed when the operation could not start.
  - `success` boolean, required — true when the action succeeded, false when it failed.
  - `datapointId` string, uuid, nullable, required — Identifier of the created datapoint when available.

## Other responses

- `400` — bad request
- `401` — unauthenticated
- `403` — unauthorized
- `404` — not found
- `409` — conflict
- `500` — internal server error

---

[API](https://skmtc.net/premai-io/apis/prem-studio-api.md) · [All operations](https://skmtc.net/premai-io/apis/prem-studio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/premai-io/prem-studio-api/revisions/2cb1f5df1b89/schema)
