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

# Query Traces

`POST /traces/query`

## Request body

- TracesQueryRequest
  - `filtering` FilteringInput
    - `operator` 'and' | 'or' | 'not' | 'nand' | 'nor'
    - `conditions` union[]
      - union
        - Condition
          - `field` string, required
          - `key` string, nullable
          - `value` union
            - string
            - integer
            - number
            - boolean
            - unknown[]
              - …
            - object
          - `operator` union
            - 'is' | 'is_not'
            - 'eq' | 'neq' | 'gt' | 'lt' | 'gte' | 'lte' | 'btwn'
            - 'startswith' | 'endswith' | 'contains' | 'matches' | 'like'
            - 'in' | 'not_in'
            - 'has' | 'has_not'
            - 'exists' | 'not_exists'
          - `options` union
            - TextOptions
              - …
            - ListOptions
              - …
        - FilteringInput — recursive
  - `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
  - `query_ref` AgentaSdkModelsSharedReference
    - `version` string, nullable
    - `slug` string, nullable
    - `id` string, uuid, nullable
  - `query_variant_ref` AgentaSdkModelsSharedReference
    - `version` string, nullable
    - `slug` string, nullable
    - `id` string, uuid, nullable
  - `query_revision_ref` AgentaSdkModelsSharedReference
    - `version` string, nullable
    - `slug` string, nullable
    - `id` string, uuid, nullable

## Response `200`

Successful Response

- TracesResponse
  - `count` integer
  - `traces` TraceOutput[], nullable
    - `spans` object, nullable
    - `trace_id` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-04-18** `c469c2f6cdba` — 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/traces/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/c469c2f6cdba/schema)
