---
title: "Create Trace"
method: POST
path: "/preview/traces/"
tags: ["Observability"]
---

# Create Trace

`POST /preview/traces/`

## Query parameters

- `sync` boolean

## Request body

- TraceRequest
  - `trace` TraceInput
    - `spans` object, nullable
    - `trace_id` string, nullable

## Response `201`

Successful Response

- TraceIdResponse
  - `count` integer
  - `trace_id` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-03-07** `20311f763505` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/preview/traces/post.md)

---

[API](https://skmtc.dev/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.dev/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/agenta-ai/agenta-api/revisions/20311f763505/schema)
