> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List SCM Organizations

> Lists SCM organizations the user belongs to.

`Unary` · [`Runners`](/docs/api-reference/generated/runner/overview)

Lists SCM organizations the user belongs to.

Use this method to:

* Get all organizations for a user on a specific SCM host
* Check organization admin permissions for webhook creation

### Examples

* List GitHub organizations:

  Lists all organizations the user belongs to on GitHub.

  ```yaml theme={null}
  runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
  scmHost: "github.com"
  ```

* Search GitLab groups:

  Returns the first page of GitLab groups matching the substring.

  ```yaml theme={null}
  runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
  scmHost: "gitlab.com"
  query: "platform"
  pagination:
    pageSize: 25
  ```

## Endpoint

```text theme={null}
POST /api/gitpod.v1.RunnerService/ListSCMOrganizations
```

Send a Bearer token as described in [Authentication](/docs/api-reference#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

<CodeGroup>
  ```bash cURL theme={null}
  export ONA_HOST=https://app.ona.com
  export ONA_API_KEY=<your-token>

  curl --request POST \
    --url "$ONA_HOST/api/gitpod.v1.RunnerService/ListSCMOrganizations" \
    --header "Authorization: Bearer $ONA_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
    "runnerId": "<runner-id>"
  }'
  ```

  ```python Python theme={null}
  import gitpod.v1.runner_pb2 as runner_pb2
  from ona_sdk import create_client_from_env

  ona = create_client_from_env()
  request = runner_pb2.ListSCMOrganizationsRequest(
      runner_id="<runner-id>",
  )
  response = ona.services.runner.list_scm_organizations(request)
  print(response)
  ```

  ```typescript TypeScript theme={null}
  import { create } from "@bufbuild/protobuf";
  import { createClientFromEnv } from "@gitpod/sdk";
  import { ListSCMOrganizationsRequestSchema } from "@gitpod/sdk/gitpod/v1/runner_pb";

  async function main() {
    const ona = createClientFromEnv();
    const request = create(ListSCMOrganizationsRequestSchema, {
      runnerId: "<runner-id>",
    });
    const response = await ona.services.runner.listSCMOrganizations(request);
    console.log(response);
  }

  main().catch(console.error);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"log"

  	"connectrpc.com/connect"
  	"github.com/gitpod-io/gitpod-sdk-go/sdk"
  	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
  )

  func main() {
  	ona, err := sdk.NewFromEnv()
  	if err != nil {
  		log.Fatal(err)
  	}

  	request := connect.NewRequest(&gitpodpb.ListSCMOrganizationsRequest{
  		RunnerId: "<runner-id>",
  	})
  	response, err := ona.Services.Runner.ListSCMOrganizations(context.Background(), request)
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(response.Msg)
  }
  ```

  ```json Request body theme={null}
  {
    "runnerId": "<runner-id>"
  }
  ```
</CodeGroup>

## Request

`gitpod.v1.ListSCMOrganizationsRequest`

| Field        | Type                                                    | Required | Description                                                                                                                                                                                                                                                                     |
| ------------ | ------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `runnerId`   | string                                                  | No       | Constraints: `string.uuid=true`.                                                                                                                                                                                                                                                |
| `scmHost`    | string                                                  | No       | The SCM host to list organizations from (e.g., "github.com", "gitlab.com") Constraints: `string.min_len=1`.                                                                                                                                                                     |
| `query`      | string                                                  | No       | Optional substring filter applied to the organization name. - GitLab: forwarded to the upstream `search` parameter (server-side, case-insensitive substring on name/path). - GitHub and Bitbucket: not implemented as they don't support searching Empty value means no filter. |
| `pagination` | [PaginationRequest](#type-gitpod-v1-pagination-request) | No       | Pagination parameters. When unset, defaults to the standard PaginationRequest defaults (page\_size 25, max 100). Tokens are opaque and provider-specific.                                                                                                                       |

## Response

`gitpod.v1.ListSCMOrganizationsResponse`

| Field           | Type                                                                                         | Required | Description                                                                             |
| --------------- | -------------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------- |
| `organizations` | array of [SCMOrganization](#type-gitpod-v1-list-scm-organizations-response-scm-organization) | No       | List of organizations the user belongs to                                               |
| `pagination`    | [PaginationResponse](#type-gitpod-v1-pagination-response)                                    | No       | Pagination cursor for fetching the next page. Empty `next_token` means no more results. |

## Related types

<a id="type-gitpod-v1-list-scm-organizations-response-scm-organization" />

<Accordion title="SCMOrganization">
  `gitpod.v1.ListSCMOrganizationsResponse.SCMOrganization`

  | Field     | Type    | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                    |
  | --------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `name`    | string  | No       | Organization name/slug (e.g., "gitpod-io")                                                                                                                                                                                                                                                                                                                                                                     |
  | `url`     | string  | No       | Organization URL (e.g., "[https://github.com/gitpod-io](https://github.com/gitpod-io)")                                                                                                                                                                                                                                                                                                                        |
  | `isAdmin` | boolean | No       | **Deprecated.** Deprecated: this field is unused by all known consumers and is scheduled for removal in a future release. Do not read it. Originally intended to gate organization-level webhook creation in the dashboard, but that gating was never implemented. Populating this field on the GitLab path requires a second fully-paginated ListGroups call, which is the main reason we are deprecating it. |
</Accordion>

<a id="type-gitpod-v1-pagination-request" />

<Accordion title="PaginationRequest">
  `gitpod.v1.PaginationRequest`

  | Field      | Type    | Required | Description                                                                                                                              |
  | ---------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
  | `pageSize` | integer | No       | Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. Constraints: `int32.gte=0, int32.lte=100`. |
  | `token`    | string  | No       | Token for the next set of results that was returned as next\_token of a PaginationResponse                                               |
</Accordion>

<a id="type-gitpod-v1-pagination-response" />

<Accordion title="PaginationResponse">
  `gitpod.v1.PaginationResponse`

  | Field       | Type   | Required | Description                                                                             |
  | ----------- | ------ | -------- | --------------------------------------------------------------------------------------- |
  | `nextToken` | string | No       | Token passed for retrieving the next set of results. Empty if there are no more results |
</Accordion>
