Datasets
Add Trace to Dataset
POST
Add an observability trace (or a specific span subtree) as a row in the draft dataset version for a dataset group. You can export an entire trace (anchored at the earliest root span) or choose a specific span to anchor on — in which case that span and its direct children become the dataset columns.Documentation Index
Fetch the complete documentation index at: https://promptlayer-add-demo-projects.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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
Authorizations
Body
application/json
ID of the dataset group to add the trace row to.
Required range:
x >= 1ID of the trace to add as a dataset row.
Minimum string length:
1Optional span ID. When omitted the row anchors on the trace's earliest root span (Trace export). When provided the row anchors on that span and its direct children become the columns (Span export).
Minimum string length:
1Response
Trace added to draft dataset.

