---
title: "get spans fileter by query"
method: POST
path: "/tests/{testId}/run/{runId}/search-spans"
tags: ["api"]
---

# get spans fileter by query

`POST /tests/{testId}/run/{runId}/search-spans`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/tests/{testId}/run/{runId}/search-spans`
- Auth: none declared

get spans fileter by query

## Parameters

- `./parameters.yaml#/components/parameters/testId` (unresolved $ref)
- `./parameters.yaml#/components/parameters/runId` (unresolved $ref)

## Request body

- object
  - `query` string: query to filter spans, can be either a full text search or a Span Query Language query

## Response `200`

trace containing matching spans only

- SearchSpansResult (unresolved $ref)

## Changes

- **2024-02-08** `62afd3fc660d`: 1 info
  - endpoint added
- **2022-11-17** `9ee6203c38fa`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/kubeshop/apis/tracetest/changes/tests/:testId/run/:runId/search-spans/post.md)

---

[API](https://skmtc.dev/kubeshop/apis/tracetest.md) - [All operations](https://skmtc.dev/kubeshop/apis/tracetest/llms.txt) - [OpenAPI document](https://skmtc.dev/kubeshop/apis/tracetest/revisions/fad7f202ff22?raw)
