---
title: "List Sessions"
method: POST
path: "/tracing/sessions/query"
tags: ["Deprecated"]
deprecated: true
---

# List Sessions

`POST /tracing/sessions/query`

> **Deprecated.**

List distinct session IDs from span attributes.

Returns the distinct values of `ag.session.id` across spans in the
current project, in a windowed, cursor-paginated form. Use this to
drive a session-picker UI before drilling into the spans of each
session.

The `realtime` flag controls the cursor field:

- `false` or unset — paginate by a stable `first_active` cursor
  (safe to iterate under heavy write load).
- `true` — paginate by `last_active`, reflecting ongoing activity
  but less stable between pages.

The response includes a `windowing` cursor; pass it as `windowing.next`
on the next call to continue.

## Request body

- SessionsQueryRequest — Request body for `POST /tracing/sessions/query`.
  - `realtime` boolean, nullable — When `true`, paginate by `last_active` (reflects ongoing activity but can shift between pages). When `false` or unset, paginate by the stable `first_active` cursor.
  - `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

- SessionIdsResponse
  - `count` integer — Number of session IDs in this page.
  - `session_ids` string[] — Distinct values of `ag.session.id` in this page.
  - `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

## Other responses

- `422` — Validation Error

## Changes

> 359 revisions in range; 46 could not be searched.

- **2025-06-27** `e3e84db47198` — 1 info
  - api path removed with deprecation

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