---
title: "Create Annotation"
method: POST
path: "/preview/annotations/"
tags: ["Annotations"]
---

# Create Annotation

`POST /preview/annotations/`

## Request body

- AnnotationCreateRequest
  - `annotation` AnnotationCreate, required
    - `origin` 'custom' | 'human' | 'auto'
    - `kind` 'adhoc' | 'eval' | 'play'
    - `channel` 'otlp' | 'web' | 'sdk' | 'api'
    - `tags` object, nullable
    - `meta` object, nullable
    - `data` object, required
    - `references` SimpleTraceReferences, required
      - `query` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_variant` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_revision` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_variant` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_revision` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_variant` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_revision` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_variant` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_revision` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testcase` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
    - `links` union, required
      - object
      - Link[]
        - `span_id` string, nullable
        - `trace_id` string, nullable

## Response `200`

Successful Response

- AnnotationResponse
  - `count` integer
  - `annotation` Annotation
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
    - `deleted_at` string, date-time, nullable
    - `created_by_id` string, uuid, nullable
    - `updated_by_id` string, uuid, nullable
    - `deleted_by_id` string, uuid, nullable
    - `span_id` string, nullable
    - `trace_id` string, nullable
    - `origin` 'custom' | 'human' | 'auto'
    - `kind` 'adhoc' | 'eval' | 'play'
    - `channel` 'otlp' | 'web' | 'sdk' | 'api'
    - `tags` object, nullable
    - `meta` object, nullable
    - `data` object, required
    - `references` SimpleTraceReferences, required
      - `query` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_variant` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_revision` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_variant` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_revision` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_variant` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_revision` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_variant` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_revision` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testcase` AgentaSdkModelsSharedReference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
    - `links` union, required
      - object
      - Link[]
        - `span_id` string, nullable
        - `trace_id` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-02-13** `72fe88316d15` — 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status
- **2026-01-14** `53da4c9de2b7` — 14 breaking, 40 info
  - removed `#/components/schemas/oss__src__core__shared__dtos__Reference` from the `annotation/references/application` request property `anyOf` list
  - removed `#/components/schemas/oss__src__core__shared__dtos__Reference` from the `annotation/references/application_revision` request property `anyOf` list
  - removed `#/components/schemas/oss__src__core__shared__dtos__Reference` from the `annotation/references/application_variant` request property `anyOf` list
  - removed `#/components/schemas/oss__src__core__shared__dtos__Reference` from the `annotation/references/evaluator` request property `anyOf` list
  - …50 more
- **2025-11-05** `e62506c24377` — 13 breaking, 14 warning, 49 info
  - removed `#/components/schemas/AnnotationReference-Input` from the `annotation/references/testcase` request property `anyOf` list
  - removed `#/components/schemas/AnnotationReference-Input` from the `annotation/references/testset` request property `anyOf` list
  - removed the enum value `auto` of the request property `annotation/kind`
  - removed the enum value `custom` of the request property `annotation/kind`
  - …72 more
- **2025-06-27** `e3e84db47198` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/preview/annotations/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/72fe88316d15/schema)
