---
title: "Query Traces"
method: POST
path: "/simple/traces/query"
tags: ["Traces"]
---

# Query Traces

`POST /simple/traces/query`

Query "simple" traces.

Filter annotations and feedback by `origin`, `kind`, `channel`,
`tags`, `meta`, `references`, and `links`. The shape of the
request body is described in the
[Simple Endpoints](/reference/api-guide/simple-endpoints#query-traces)
guide, including the distinction between filtering via
`trace.links` (inbound links on the trace) and the top-level
`links` (batch GET by the trace's own IDs).

Use this endpoint when building feedback or annotation UIs.
For span-level queries across all trace types, use
`POST /tracing/spans/query`.

## Request body

- SimpleTraceQueryRequest — Request body for `POST /simple/traces/query`.
  - `trace` SimpleTraceQuery
    - `origin` 'custom' | 'human' | 'auto'
    - `kind` 'adhoc' | 'eval' | 'play'
    - `channel` 'otlp' | 'web' | 'sdk' | 'api'
    - `tags` object, nullable
    - `meta` object, nullable
    - `references` SimpleTraceReferences
      - `query` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testcase` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `selector` object, nullable
    - `links` union
      - object
      - OTelLinkInput[]
        - `span_id` string, nullable
        - `trace_id` string, nullable
        - `attributes` object, nullable
  - `links` OTelLinkInput[], nullable — Batch GET by the trace's own `(trace_id, span_id)`. Each entry matches the trace whose own identity equals the pair. Distinct from `trace.links`, which filters on inbound links.
    - `span_id` string, nullable
    - `trace_id` string, nullable
    - `attributes` object, 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

- SimpleTracesResponse — Response from `POST /simple/traces/query`.
  - `count` integer — Number of matching traces in this page.
  - `traces` SimpleTrace[] — The matching traces in the high-level `SimpleTrace` shape.
    - `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
    - `attributes` object, 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` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testcase` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `selector` object, nullable
    - `links` union, required
      - object
      - OTelLinkOutput[]
        - `span_id` string, nullable
        - `trace_id` string, nullable
        - `attributes` object, nullable

## Other responses

- `422` — Validation Error

---

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