Search Traces with Advanced Filters
Search traces using the FilterExpr DSL for complex, composable queries.
Group By Mode:
run(default): ReturnsPaginatedResponse[TraceDetail]with full span treessession: ReturnsPaginatedResponse[TraceSessionStats]with aggregated session stats
Supported Operators:
- Comparison:
EQ,NEQ,GT,GTE,LT,LTE - Inclusion:
IN - String matching:
CONTAINS(case-insensitive substring),STARTSWITH(prefix) - Logical:
AND,OR,NOT
Filterable Fields: trace_id, name, status, start_time, end_time, duration_ms, run_id, session_id, user_id, agent_id, team_id, workflow_id, created_at
Example Request Body (runs):
{
"filter": {"op": "EQ", "key": "status", "value": "OK"},
"group_by": "run",
"page": 1,
"limit": 20
}
Example Request Body (sessions):
{
"filter": {"op": "CONTAINS", "key": "agent_id", "value": "stock"},
"group_by": "session",
"page": 1,
"limit": 20
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Database ID to query traces from
Body
Request body for POST /traces/search with advanced filtering.
The filter field accepts a FilterExpr DSL dict supporting composable queries with AND/OR/NOT logic and operators like EQ, NEQ, GT, GTE, LT, LTE, IN, CONTAINS, STARTSWITH.
Example for run grouping (default): { "filter": { "op": "AND", "conditions": [ {"op": "EQ", "key": "status", "value": "OK"}, {"op": "CONTAINS", "key": "user_id", "value": "admin"} ] }, "group_by": "run", "page": 1, "limit": 20 }
Example for session grouping: { "filter": {"op": "EQ", "key": "agent_id", "value": "my-agent"}, "group_by": "session", "page": 1, "limit": 20 }
FilterExpr DSL as JSON dict. Supports operators: EQ, NEQ, GT, GTE, LT, LTE, IN, CONTAINS, STARTSWITH, AND, OR, NOT.
Grouping mode: 'run' returns individual TraceDetail, 'session' returns aggregated TraceSessionStats.
run, session Page number (1-indexed)
x >= 1Number of traces per page (max 100)
1 <= x <= 100