---
title: "Create trace annotations"
method: POST
path: "/v1/trace_annotations"
tags: ["traces"]
---

# Create trace annotations

`POST /v1/trace_annotations`

## Query parameters

- `sync` boolean — If true, fulfill request synchronously.

## Request body

- AnnotateTracesRequestBody
  - `data` TraceAnnotationData[], required — The trace annotations to be upserted
    - `name` string, required — The name of the annotation
    - `annotator_kind` 'LLM' | 'CODE' | 'HUMAN', required — The kind of annotator used for the annotation
    - `result` AnnotationResult
      - `label` string, nullable — The label assigned by the annotation
      - `score` number, nullable — The score assigned by the annotation
      - `explanation` string, nullable — Explanation of the annotation result
    - `metadata` object, nullable — Metadata for the annotation
    - `identifier` string — The identifier of the annotation. If provided, the annotation will be updated if it already exists.
    - `trace_id` string, required — OpenTelemetry Trace ID (hex format w/o 0x prefix)

## Response `200`

Successful Response

- AnnotateTracesResponseBody
  - `data` InsertedTraceAnnotation[], required
    - `id` string, required — The ID of the inserted trace annotation

## Other responses

- `403` — Forbidden
- `404` — Trace not found
- `422` — Validation Error

---

[API](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api.md) · [All operations](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/arize-ai/arize-phoenix-rest-api/versions/5339b2afd3a2/schema)
