---
title: "Fetch Legacy Analytics"
method: POST
path: "/tracing/spans/analytics"
tags: ["Observability"]
---

# Fetch Legacy Analytics

`POST /tracing/spans/analytics`

## Query parameters

- `focus` 'trace' | 'span'
- `format` 'agenta' | 'opentelemetry'
- `oldest` union
  - string
  - integer
- `newest` union
  - string
  - integer
- `limit` integer, nullable
- `interval` integer, nullable
- `rate` number, nullable
- `filter` unknown

## Response `200`

Successful Response

- OldAnalyticsResponse
  - `count` integer
  - `buckets` Bucket[]
    - `timestamp` string, date-time, required
    - `interval` integer, required
    - `total` Analytics, required
      - `count` integer, nullable
      - `duration` number, nullable
      - `costs` number, nullable
      - `tokens` number, nullable
    - `errors` Analytics, required
      - `count` integer, nullable
      - `duration` number, nullable
      - `costs` number, nullable
      - `tokens` number, 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` — 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/tracing/spans/analytics/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)
