---
title: "Query Annotations"
method: POST
path: "/preview/annotations/query"
tags: ["Evals"]
---

# Query Annotations

`POST /preview/annotations/query`

## Request body

- AnnotationQueryRequest
  - `annotation` AnnotationQuery
    - `trace_id` string, nullable
    - `span_id` string, nullable
    - `kind` 'custom' | 'human' | 'auto'
    - `source` 'web' | 'sdk' | 'api'
    - `metadata` object, nullable
    - `references` AnnotationReferencesInput
      - `evaluator` AnnotationReferenceInput, required
        - `id` string, uuid, nullable
        - `slug` string, nullable
        - `version` string, nullable
        - `attributes` object
      - `testset` AnnotationReferenceInput
        - `id` string, uuid, nullable
        - `slug` string, nullable
        - `version` string, nullable
        - `attributes` object
      - `testcase` AnnotationReferenceInput
        - `id` string, uuid, nullable
        - `slug` string, nullable
        - `version` string, nullable
        - `attributes` object
    - `links` object, nullable

## Response `200`

Successful Response

- AnnotationsResponse
  - `count` integer, required
  - `oldest` string, date-time, nullable
  - `limit` integer, nullable
  - `annotations` 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, required
    - `trace_id` string, required
    - `kind` 'custom' | 'human' | 'auto'
    - `source` 'web' | 'sdk' | 'api'
    - `data` object, required
    - `metadata` object, nullable
    - `references` AnnotationReferencesOutput, required
      - `evaluator` AnnotationReferenceOutput, required
        - `id` string, uuid, nullable
        - `slug` string, nullable
        - `version` string, nullable
      - `testset` AnnotationReferenceOutput
        - `id` string, uuid, nullable
        - `slug` string, nullable
        - `version` string, nullable
      - `testcase` AnnotationReferenceOutput
        - `id` string, uuid, nullable
        - `slug` string, nullable
        - `version` string, nullable
    - `links` object, required

## Other responses

- `422` — Validation Error

## Changes

- **2025-06-27** `e3e84db47198` — 1 info
  - endpoint added

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