---
title: "SearchRepositories"
method: POST
path: "/gitpod.v1.RunnerService/SearchRepositories"
tags: ["gitpod.v1.RunnerService"]
---

# SearchRepositories

`POST /gitpod.v1.RunnerService/SearchRepositories`

Searches for repositories across all authenticated SCM hosts.

 Use this method to:
 - List available repositories
 - Search repositories by name or content
 - Discover repositories for environment creation

 Returns repositories from all authenticated SCM hosts in natural sort order.
 If no repositories are found, returns an empty list.

 ### Examples

 - List all repositories:

   Returns up to 25 repositories from all authenticated hosts.

   ```yaml
   runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
   ```

 - Search repositories:

   Searches for repositories matching the query across all hosts.

   ```yaml
   runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
   searchString: "my-project"
   limit: 10
   ```

## Request body

- GitpodV1SearchRepositoriesRequest
  - `limit` integer — Maximum number of repositories to return. Default: 25, Maximum: 100 Deprecated: Use pagination.page_size instead
  - `pagination` GitpodV1PaginationRequest
    - `pageSize` integer — Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100.
    - `token` string — Token for the next set of results that was returned as next_token of a PaginationResponse
  - `runnerId` string, uuid
  - `scmHost` string — The SCM's host to retrieve repositories from
  - `searchMode` 'SEARCH_MODE_UNSPECIFIED' | 'SEARCH_MODE_KEYWORD' | 'SEARCH_MODE_NATIVE'
  - `searchString` string — Search query - interpretation depends on search_mode

## Response `200`

Success

- GitpodV1SearchRepositoriesResponse
  - `lastPage` integer — Deprecated: Use pagination token instead. Total pages can be extracted from token.
  - `pagination` GitpodV1PaginationResponse
    - `nextToken` string — Token passed for retrieving the next set of results. Empty if there are no more results
  - `repositories` GitpodV1SearchRepositoriesResponseRepository[] — List of repositories matching the search criteria
    - `name` string — Repository name (e.g., "my-project")
    - `url` string — Repository URL (e.g., "https://github.com/owner/my-project")

## Other responses

- `default` — Error

---

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