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

# Query Annotations

`POST /annotations/query`

## Request body

- AnnotationQueryRequest
  - `annotation` AnnotationQuery
    - `origin` 'custom' | 'human' | 'auto'
    - `kind` 'adhoc' | 'eval' | 'play'
    - `channel` 'otlp' | 'web' | 'sdk' | 'api'
    - `tags` object, nullable
    - `meta` object, nullable
    - `references` SimpleTraceReferences
      - `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
      - object
      - Link[]
        - `span_id` string, nullable
        - `trace_id` string, nullable
  - `annotation_links` Link[], nullable
    - `span_id` string, nullable
    - `trace_id` string, nullable
  - `windowing` Windowing
    - `newest` string, date-time, nullable
    - `oldest` string, date-time, nullable
    - `next` string, uuid, nullable
    - `limit` integer, nullable
    - `order` 'ascending' | 'descending', nullable
    - `interval` integer, nullable
    - `rate` number, nullable

## Response `200`

Successful Response

- AnnotationsResponse
  - `count` integer
  - `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, 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-27** `8fcd55a5a656` — 1 info
  - endpoint added
- **2025-06-27** `e3e84db47198` — 1 breaking
  - api path removed without deprecation

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