Query Spans
POST/spans/query
Query spans as a flat list.
Thin wrapper over the shared span-query backend that forces
focus = "span". Use this when you want a paged list of spans
regardless of trace hierarchy — for example, to surface all LLM
calls across traces or to stream spans into an external system.
Request body
filtering— span-level conditions (fields onSpanandattributespaths).windowing— cursor pagination and time range (see Query Pattern).query_ref,query_variant_ref,query_revision_ref— resolve filtering and windowing from a saved query revision. If the revision's storedformatting.focusistrace, this endpoint returns409— callPOST /traces/queryfor that revision.
Response
Returns {count, spans}. For the nested per-trace shape, call
POST /traces/query or POST /tracing/spans/query with
focus="trace" instead.
Request
Responses
- 200
- 422
Successful Response
Validation Error