Skip to content
Ona Docs

ListSCMOrganizations

runners.list_scm_organizations(RunnerListScmOrganizationsParams**kwargs) -> SyncOrganizationsPage[RunnerListScmOrganizationsResponse]
POST/gitpod.v1.RunnerService/ListSCMOrganizations

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.

    runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
    scmHost: "github.com"
  • Search GitLab groups:

    Returns the first page of GitLab groups matching the substring.

    runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
    scmHost: "gitlab.com"
    query: "platform"
    pagination:
      pageSize: 25
ParametersExpand Collapse
token: Optional[str]
page_size: Optional[int]
maximum100
minimum0
query: Optional[str]

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.
runner_id: Optional[str]
formatuuid
scm_host: Optional[str]

The SCM host to list organizations from (e.g., “github.com”, “gitlab.com”)

minLength1
ReturnsExpand Collapse
class RunnerListScmOrganizationsResponse:
Deprecatedis_admin: Optional[bool]

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.

name: Optional[str]

Organization name/slug (e.g., “gitpod-io”)

url: Optional[str]

Organization URL (e.g., “https://github.com/gitpod-io”)

ListSCMOrganizations

import os
from gitpod import Gitpod

client = Gitpod(
    bearer_token=os.environ.get("GITPOD_API_KEY"),  # This is the default and can be omitted
)
page = client.runners.list_scm_organizations(
    runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
    scm_host="github.com",
)
page = page.organizations[0]
print(page.is_admin)
{
  "organizations": [
    {
      "isAdmin": true,
      "name": "name",
      "url": "url"
    }
  ],
  "pagination": {
    "nextToken": "nextToken"
  }
}
Returns Examples
{
  "organizations": [
    {
      "isAdmin": true,
      "name": "name",
      "url": "url"
    }
  ],
  "pagination": {
    "nextToken": "nextToken"
  }
}