v1

latestOpenAPI 3.1.02026-07-26231646860.9 KB
trace

Export Records

post/v2/projects/{project_id}/export_records

Path parameters

project_idstring uuid4 required

Request body

column_idsstring[] nullable

Column IDs to include in the export. Applies only to CSV exports.

export_format'csv' | 'jsonl' | 'jsonl_flat'
redactboolean

Redact sensitive data

file_namestring nullable

Optional filename for the exported file

export_computed_metrics_onlyboolean

When true, export only enabled scorer metrics with computed values (success or roll_up). For session exports, omit entire sessions unless every enabled metric at session, trace, or span level is ready (success, roll_up, or not_applicable). Not supported with export_format=jsonl_flat (returns 422); use jsonl or csv instead.

log_stream_idstring uuid4 nullable

Log stream id associated with the traces.

experiment_idstring uuid4 nullable

Experiment id associated with the traces.

metrics_testing_idstring uuid4 nullable

Metrics testing id associated with the traces.

root_type'session' | 'trace' | 'span' required

The root-level type of a logged step hierarchy.

Maps fine-grained StepType values to the three top-level categories used throughout the platform: session, trace, and span.

include_code_metric_metadataboolean

If True, include per-row scorer metadata (the dict returned alongside the score by code-based scorers via the (score, metadata) tuple-return contract) on each MetricSuccess in the export. Off by default to keep payloads small for callers that don't need it.

Example request

{
  "column_ids": [
    "input",
    "output",
    "created_at"
  ],
  "export_format": "jsonl",
  "filters": [
    {
      "case_sensitive": true,
      "name": "input",
      "operator": "eq",
      "type": "text",
      "value": "example input"
    }
  ],
  "log_stream_id": "00000000-0000-0000-0000-000000000000",
  "root_type": "trace",
  "sort": {
    "ascending": false,
    "name": "created_at",
    "sort_type": "column"
  }
}

Response

Successful Response

{"stackTrail":"paths:/v2/projects/{project_id}/export_records:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}