> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tracectrl.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List Sessions

> Returns recent traces grouped as sessions

Returns the most recent 200 traces, each summarized with root span info, agent name, span count, duration, and error status.

### Query Parameters

<ParamField query="service" type="string">Filter sessions by service name.</ParamField>

### Response

Array of session summary objects:

<ResponseField name="trace_id" type="string">OpenTelemetry trace ID</ResponseField>
<ResponseField name="start_time" type="string">ISO-8601 timestamp of first span</ResponseField>
<ResponseField name="end_time" type="string">ISO-8601 timestamp of last span end</ResponseField>
<ResponseField name="total_duration_ns" type="integer">Wall-clock trace duration in nanoseconds</ResponseField>
<ResponseField name="span_count" type="integer">Number of spans in this trace</ResponseField>
<ResponseField name="root_span_name" type="string">Name of the root span (entry point)</ResponseField>
<ResponseField name="root_span_id" type="string">Span ID of the root span</ResponseField>
<ResponseField name="agent_name" type="string">Primary agent name (first agent seen in trace)</ResponseField>
<ResponseField name="has_error" type="boolean">`true` if any span in the trace has an error status</ResponseField>

<ResponseExample>
  ```json 200 theme={"dark"}
  [
    {
      "trace_id": "abc123def456789012345678",
      "start_time": "2026-03-17T14:20:00Z",
      "end_time": "2026-03-17T14:20:03.5Z",
      "total_duration_ns": 3500000000,
      "span_count": 12,
      "root_span_name": "AgentExecutor",
      "root_span_id": "span123",
      "agent_name": "Researcher",
      "has_error": false
    }
  ]
  ```
</ResponseExample>
