---
title: "Search tests"
method: GET
path: "/ci/{owner}/repositories/{repository}/search/tests"
tags: ["test_insights"]
---

# Search tests

`GET /ci/{owner}/repositories/{repository}/search/tests`

Search tests in a repository.

## Path parameters

- `owner` string, required — The owner of the repository
- `repository` string, required — The name of the repository

## Query parameters

- `test_name` string[], nullable — Filter by test name. Pass multiple times to combine matches. Supports glob patterns (`*`, `?`). Omit to return all test identities.
- `sort` 'executions_count' | 'test_name' | 'pipeline_name' | 'job_name' | 'health_status' | 'health_confidence' | 'failed_executions_impact' | 'failed_executions_ratio' — Sort field
- `direction` 'asc' | 'desc' — Sort direction
- `test_name_exclude` string[], nullable — The test name to exclude
- `pipeline_name` string[], nullable — The pipeline name to filter on
- `pipeline_name_exclude` string[], nullable — The pipeline name to exclude
- `job_name` string[], nullable — The job name to filter on
- `job_name_exclude` string[], nullable — The job name to exclude
- `health_status` HealthStatus[], nullable — The health status to filter on
- `health_status_exclude` HealthStatus[], nullable — The health status to exclude
- `health_confidence` HealthConfidence[], nullable — The health confidence to filter on
- `health_confidence_exclude` HealthConfidence[], nullable — The health confidence to exclude
- `failed_executions_impact` string[], nullable — The failed executions impact to filter on
- `failed_executions_impact_exclude` string[], nullable — The failed executions impact to exclude
- `cursor` string, nullable — The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get first/previous/next/last pages
- `per_page` integer — The number of items per page

## Response `200`

Successful Response

- SearchTestsResponse
  - `size` integer, required — The number of items in this page
  - `per_page` integer, required — The number of items per page
  - `tests` TestSearchResult[], required — Test identities matching the search query.
    - `test_id` string, uuid5, required — Stable identifier of the test. Pass it to the per-test endpoints to fetch details, metrics, or failures.
    - `test_name` string, required — Fully qualified name of the test as reported by the CI provider.
    - `pipeline_name` string, required — Name of the pipeline (workflow) that ran the test.
    - `job_name` string, required — Name of the job within the pipeline that ran the test.
    - `metrics` TestSearchResultMetrics, required
      - `health_status` 'healthy' | 'flaky' | 'broken', required
      - `health_confidence` 'low' | 'medium' | 'high', required
      - `failed_executions_impact` 'low' | 'medium' | 'high', nullable, required — Impact of the test's failures, derived from its failure ratio. `null` for healthy tests, which have no meaningful failure impact.
  - `total` integer, required — Total number of test identities matching the search query, across all pages.

## Other responses

- `403` — Forbidden
- `404` — Not found
- `409` — Conflict
- `422` — Unprocessable entity

---

[API](https://skmtc.net/mergify/apis/mergify-api.md) · [All operations](https://skmtc.net/mergify/apis/mergify-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mergify/mergify-api/revisions/ae394a06c465/schema)
