## 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 ``` ### Body Parameters - `limit: optional number` Maximum number of repositories to return. Default: 25, Maximum: 100 Deprecated: Use pagination.page_size instead - `pagination: optional object { token, pageSize }` Pagination parameters for repository search - `token: optional string` Token for the next set of results that was returned as next_token of a PaginationResponse - `pageSize: optional number` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. - `runnerId: optional string` - `scmHost: optional string` The SCM's host to retrieve repositories from - `searchMode: optional SearchMode` Search mode determines how search_string is interpreted - `"SEARCH_MODE_UNSPECIFIED"` - `"SEARCH_MODE_KEYWORD"` - `"SEARCH_MODE_NATIVE"` - `searchString: optional string` Search query - interpretation depends on search_mode ### Returns - `lastPage: optional number` Deprecated: Use pagination token instead. Total pages can be extracted from token. - `pagination: optional object { nextToken }` Pagination information for the response. Token format: "NEXT_PAGE/TOTAL_PAGES/TOTAL_COUNT" (e.g., "2/40/1000"). Use -1 for unknown values (e.g., "2/-1/-1" when totals unavailable). Empty token means no more pages. - `nextToken: optional string` Token passed for retrieving the next set of results. Empty if there are no more results - `repositories: optional array of object { name, url }` List of repositories matching the search criteria - `name: optional string` Repository name (e.g., "my-project") - `url: optional string` Repository URL (e.g., "https://github.com/owner/my-project") ### Example ```http curl https://app.gitpod.io/api/gitpod.v1.RunnerService/SearchRepositories \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $GITPOD_API_KEY" \ -d '{}' ``` #### Response ```json { "lastPage": 0, "pagination": { "nextToken": "nextToken" }, "repositories": [ { "name": "name", "url": "url" } ] } ```