> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veri.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Import a window of request traces as dataset rows



## OpenAPI

````yaml /api-reference/openapi.json post /v1/datasets/{dataset_id}/import-traces
openapi: 3.1.0
info:
  title: Veri API
  description: >-
    REST API for the Veri RL post-training platform. All requests require a
    Bearer API key (`vk_` prefix).
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.veri.studio
    description: Production
security: []
tags:
  - name: Training jobs
    description: Create, monitor, and manage training jobs.
  - name: Datasets
    description: Upload and connect training datasets.
  - name: Deployments
    description: Serve trained models and run inference.
  - name: Volumes
    description: Persistent file storage mounted into jobs.
  - name: Models
    description: Custom model registry deployments serve from.
  - name: Regions
    description: Discover available launch regions.
  - name: GPU
    description: Live GPU availability by provider and region.
  - name: Code artifacts
    description: Upload custom training script bundles.
  - name: Billing
    description: Credit balance and transaction history.
  - name: API keys
    description: Create and revoke API keys.
  - name: Account
    description: The authenticated caller's identity.
  - name: Settings
    description: Account-level integrations (Weights & Biases).
  - name: Metrics
    description: Prometheus metrics export for your own observability stack.
  - name: Evaluators
    description: 'Evaluators: versioned scoring rules (LLM judge, code, human).'
  - name: Experiments
    description: >-
      Experiments: offline runs of a pinned dataset snapshot through a target,
      scored by pinned evaluators.
  - name: Annotation queues
    description: >-
      Human review: queue traces, threads and experiment items, reserve one at a
      time, score them and feed corrections back into datasets.
  - name: Monitors
    description: >-
      Monitors: evaluators scoring a sampled share of a deployment's live
      traffic.
  - name: Observability
    description: Agent conversations, agents and their traffic.
  - name: Public runs
    description: Unauthenticated reads of runs their owners published to Explore.
paths:
  /v1/datasets/{dataset_id}/import-traces:
    post:
      tags:
        - Datasets
      summary: Import a window of request traces as dataset rows
      operationId: import_traces
      parameters:
        - name: dataset_id
          in: path
          description: Dataset id or name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TraceImportRequest'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceImportResponse'
        '400':
          description: bad window/format/limit, or traces disabled
        '404':
          description: dataset or deployment not found
        '409':
          description: 'export_window_overlap: overlaps a previous import'
        '502':
          description: trace store failed mid-fetch; nothing appended
      security:
        - bearerAuth: []
components:
  schemas:
    TraceImportRequest:
      type: object
      required:
        - deployment
      properties:
        deployment:
          type: string
        from:
          type:
            - string
            - 'null'
          format: date-time
          description: Start of the trace window. Required unless `thread_id` is set.
        to:
          type:
            - string
            - 'null'
          format: date-time
          description: |-
            End of the trace window, at most 31 days after `from`. Required
            unless `thread_id` is set.
        model_version_id:
          type:
            - string
            - 'null'
        format:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RowFormat'
              description: |-
                Row format to write; defaults to the dataset's locked format.
                v1 accepts `chat` and `prompt` only.
        limit:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        snapshot:
          type: boolean
        force:
          type: boolean
        scores:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TraceScoreFilter'
              description: >-
                Keep only traces with an ok score from `evaluator` matching
                `passed` /

                `min` / `max` (e.g. the judge's failures). Window imports only.
        thread_id:
          type:
            - string
            - 'null'
          description: |-
            Import one thread of `deployment` as one row, built from its newest
            stored trace (whose messages hold the whole conversation).
            `from`/`to`/`limit`/`force`/`model_version_id` do not apply.
      additionalProperties: false
    TraceImportResponse:
      type: object
      required:
        - object
        - id
        - dataset_id
        - deployment_id
        - from
        - to
        - format
        - traces_scanned
        - rows_appended
        - skipped
        - head_row
      properties:
        object:
          type: string
        id:
          type: string
        dataset_id:
          type: string
        deployment_id:
          type: string
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        format:
          $ref: '#/components/schemas/RowFormat'
        traces_scanned:
          type: integer
          format: int32
        rows_appended:
          type: integer
          format: int32
        skipped:
          description: |-
            Per-reason counts of traces that were fetched but not written,
            e.g. {"no_choices": 3, "filtered_version": 28}.
        first_row:
          type:
            - integer
            - 'null'
          format: int64
        last_row:
          type:
            - integer
            - 'null'
          format: int64
        head_row:
          type: integer
          format: int64
        snapshot_id:
          type:
            - string
            - 'null'
    RowFormat:
      type: string
      description: |-
        The locked row format of a stream. Detected from the first row and
        enforced on every later append (a mismatched row 400s the whole batch).
      enum:
        - prompt
        - preference
        - completion
        - chat
        - eval
    TraceScoreFilter:
      type: object
      description: Score filter for a window import (see `scores`).
      required:
        - evaluator
      properties:
        evaluator:
          type: string
          description: Evaluator id or name in the caller's workspace.
        evaluator_version:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Only scores from this evaluator version; omitted matches any
            version.
        passed:
          type:
            - boolean
            - 'null'
          description: Only scores whose pass/fail verdict equals this.
        min:
          type:
            - number
            - 'null'
          format: double
          description: 'Numeric scores only: value >= min / value <= max.'
        max:
          type:
            - number
            - 'null'
          format: double
        label:
          type:
            - string
            - 'null'
          description: |-
            VS-486 (400 while VERI_FEATURE_JEV is off): a categorical label, or
            `true` / `false` for a boolean score.
        min_confidence:
          type:
            - number
            - 'null'
          format: double
          description: 'VS-486: inclusive confidence bounds, 0..1.'
        max_confidence:
          type:
            - number
            - 'null'
          format: double
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: API key with the `vk_` prefix. Create one from the dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.