---
title: "Create traces"
method: POST
path: "/v1/private/traces/batch"
tags: ["Traces"]
---

# Create traces

`POST /v1/private/traces/batch`

Create traces

## Request body

- TraceBatchWrite
  - `traces` TraceWrite[], required
    - `id` string, uuid
    - `project_name` string — If null, the default project is used
    - `name` string
    - `start_time` string, date-time, required
    - `end_time` string, date-time
    - `input` JsonListStringWrite
    - `output` JsonListStringWrite
    - `metadata` JsonListStringWrite
    - `tags` string[]
    - `error_info` ErrorInfoWrite
      - `exception_type` string, required
      - `message` string
      - `traceback` string, required
    - `last_updated_at` string, date-time
    - `ttft` number, double — Time to first token in milliseconds
    - `thread_id` string
    - `source` 'sdk' | 'experiment' | 'playground' | 'optimization' | 'evaluator'
    - `environment` string

## Response `204`

No Content

## Changes

- **2026-07-02** `3144ea40dac0` — 1 info
  - added the new `evaluator` enum value to the request property `traces/items/source`
- **2026-05-08** `b9100cf75dd3` — 1 info
  - added the new optional request property `traces/items/environment`
- **2026-05-04** `d606e84c75e4` — 1 breaking, 1 warning
  - removed the enum value `evaluator` of the request property `traces/items/source`
  - removed the request property `traces/items/environment`

[Change history](https://skmtc.dev/comet-ml/apis/opik-rest-api/changes/v1/private/traces/batch/post.md)

---

[API](https://skmtc.dev/comet-ml/apis/opik-rest-api.md) · [All operations](https://skmtc.dev/comet-ml/apis/opik-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/comet-ml/opik-rest-api/revisions/1a1bcfd67f99/schema)
