Skip to main content
GET
/
traces
/
{trace_id}
Get Trace or Span Detail
curl --request GET \
  --url https://api.example.com/traces/{trace_id} \
  --header 'Authorization: Bearer <token>'
{
  "trace_id": "a1b2c3d4",
  "name": "Stock_Price_Agent.run",
  "status": "OK",
  "duration": "1.2s",
  "start_time": "2025-11-19T10:30:00.000000+00:00",
  "end_time": "2025-11-19T10:30:01.200000+00:00",
  "total_spans": 4,
  "error_count": 0,
  "input": "What is Tesla stock price?",
  "output": "The current price of Tesla (TSLA) is $245.67.",
  "run_id": "run123",
  "session_id": "session456",
  "user_id": "user789",
  "agent_id": "stock_agent",
  "created_at": "2025-11-19T10:30:00+00:00",
  "tree": [
    {
      "id": "span1",
      "name": "Stock_Price_Agent.run",
      "type": "AGENT",
      "duration": "1.2s",
      "status": "OK",
      "spans": []
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

trace_id
string
required

Query Parameters

span_id
string | null

Optional: Span ID to retrieve specific span

run_id
string | null

Optional: Run ID to retrieve trace for

db_id
string | null

Database ID to query trace from

Response

Trace or span detail retrieved successfully

Detailed trace information with hierarchical span tree

trace_id
string
required

Unique trace identifier

name
string
required

Trace name (usually root span name)

status
string
required

Overall status (OK, ERROR)

duration
string
required

Human-readable total duration

start_time
string<date-time>
required

Trace start time (Pydantic auto-serializes to ISO 8601)

end_time
string<date-time>
required

Trace end time (Pydantic auto-serializes to ISO 8601)

total_spans
integer
required

Total number of spans in this trace

error_count
integer
required

Number of spans with errors

created_at
string<date-time>
required

Time when trace was created (Pydantic auto-serializes to ISO 8601)

tree
TraceNode · object[]
required

Hierarchical tree of spans (root nodes)

input
string | null

Input to the agent/workflow

output
string | null

Output from the agent/workflow

error
string | null

Error message if status is ERROR

run_id
string | null

Associated run ID

session_id
string | null

Associated session ID

user_id
string | null

Associated user ID

agent_id
string | null

Associated agent ID

team_id
string | null

Associated team ID

workflow_id
string | null

Associated workflow ID