外部グループの REST API エンドポイント
REST API を使って、組織で利用できる外部 ID プロバイダー グループを表示し、外部グループと組織内のチームの間の接続を管理します。
外部グループについて
これらのエンドポイントを使うには、認証されたユーザーが、チーム メンテナーであるか、またはチームに関連づけられた組織の所有者である必要があります。
メモ
- これらのエンドポイントは、Enterprise Managed Users を使うエンタープライズの一部である組織でのみ使用できます。 詳しくは、「About Enterprise Managed Users」をご覧ください。
- 組織がチームの同期を使っている場合は、API を使ってチームの同期を管理できます。 詳しくは、「チーム同期用の REST API エンドポイント」をご覧ください。
Get an external group
Displays information about the specific group's usage. Provides a list of the group's external members as well as a list of teams that this group is connected to.
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.
"Get an external group" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Members" organization permissions (write)
"Get an external group" のパラメーター
| 名前, Type, 説明 | 
|---|
| acceptstringSetting to  | 
| 名前, Type, 説明 | 
|---|
| orgstring 必須The organization name. The name is not case sensitive. | 
| group_idinteger 必須The unique identifier of the group. | 
| 名前, Type, 説明 | 
|---|
| per_pageintegerThe number of results per page for the "members" array (max 100). For more information, see "Using pagination in the REST API." Default:  | 
| pageintegerThe page number of the "members" array results to fetch. For more information, see "Using pagination in the REST API." Default:  | 
"Get an external group" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
| 200 | OK | 
"Get an external group" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com を api.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/orgs/ORG/external-group/GROUP_IDResponse
Status: 200{
  "group_id": "123",
  "group_name": "Octocat admins",
  "updated_at": "2021-01-24T11:31:04-06:00",
  "teams": [
    {
      "team_id": 1,
      "team_name": "team-test"
    },
    {
      "team_id": 2,
      "team_name": "team-test2"
    }
  ],
  "members": [
    {
      "member_id": 1,
      "member_login": "mona-lisa_eocsaxrs",
      "member_name": "Mona Lisa",
      "member_email": "mona_lisa@github.com"
    },
    {
      "member_id": 2,
      "member_login": "octo-lisa_eocsaxrs",
      "member_name": "Octo Lisa",
      "member_email": "octo_lisa@github.com"
    }
  ]
}List external groups available to an organization
Lists external groups provisioned on the enterprise that are available to an organization. You can query the groups using the display_name parameter, only groups with a group_name containing the text provided in the display_name parameter will be returned.  You can also limit your page results using the per_page parameter. GitHub Enterprise Cloud generates a url-encoded page token using a cursor value for where the next page begins. For more information on cursor pagination, see "Offset and Cursor Pagination explained."
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.
"List external groups available to an organization" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Members" organization permissions (write)
"List external groups available to an organization" のパラメーター
| 名前, Type, 説明 | 
|---|
| acceptstringSetting to  | 
| 名前, Type, 説明 | 
|---|
| orgstring 必須The organization name. The name is not case sensitive. | 
| 名前, Type, 説明 | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Default:  | 
| pageintegerPage token | 
| display_namestringLimits the list to groups containing the text in the group name | 
"List external groups available to an organization" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
| 200 | OK | 
"List external groups available to an organization" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com を api.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/orgs/ORG/external-groupsResponse
Status: 200{
  "groups": [
    {
      "group_id": "123",
      "group_name": "Octocat admins",
      "updated_at": "2021-01-24T11:31:04-06:00"
    },
    {
      "group_id": "456",
      "group_name": "Octocat docs members",
      "updated_at": "2021-03-24T11:31:04-06:00"
    }
  ]
}List a connection between an external group and a team
Lists a connection between a team and an external group.
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.
"List a connection between an external group and a team" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Members" organization permissions (write)
"List a connection between an external group and a team" のパラメーター
| 名前, Type, 説明 | 
|---|
| acceptstringSetting to  | 
| 名前, Type, 説明 | 
|---|
| orgstring 必須The organization name. The name is not case sensitive. | 
| team_slugstring 必須The slug of the team name. | 
"List a connection between an external group and a team" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
| 200 | OK | 
"List a connection between an external group and a team" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com を api.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groupsResponse
Status: 200{
  "groups": [
    {
      "group_id": "123",
      "group_name": "Octocat admins",
      "updated_at": "2021-01-24T11:31:04-06:00"
    },
    {
      "group_id": "456",
      "group_name": "Octocat docs members",
      "updated_at": "2021-03-24T11:31:04-06:00"
    }
  ]
}Update the connection between an external group and a team
Creates a connection between a team and an external group. Only one external group can be linked to a team.
You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.
"Update the connection between an external group and a team" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Members" organization permissions (write)
"Update the connection between an external group and a team" のパラメーター
| 名前, Type, 説明 | 
|---|
| acceptstringSetting to  | 
| 名前, Type, 説明 | 
|---|
| orgstring 必須The organization name. The name is not case sensitive. | 
| team_slugstring 必須The slug of the team name. | 
| 名前, Type, 説明 | 
|---|
| group_idinteger 必須External Group Id | 
"Update the connection between an external group and a team" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
| 200 | OK | 
"Update the connection between an external group and a team" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com を api.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
  -X PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groups \
  -d '{"group_id":123}'Response
Status: 200{
  "group_id": "123",
  "group_name": "Octocat admins",
  "updated_at": "2021-01-24T11:31:04-06:00",
  "teams": [
    {
      "team_id": 1,
      "team_name": "team-test"
    },
    {
      "team_id": 2,
      "team_name": "team-test2"
    }
  ],
  "members": [
    {
      "member_id": 1,
      "member_login": "mona-lisa_eocsaxrs",
      "member_name": "Mona Lisa",
      "member_email": "mona_lisa@github.com"
    },
    {
      "member_id": 2,
      "member_login": "octo-lisa_eocsaxrs",
      "member_name": "Octo Lisa",
      "member_email": "octo_lisa@github.com"
    }
  ]
}Remove the connection between an external group and a team
Deletes a connection between a team and an external group.
You can manage team membership with your IdP using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
"Remove the connection between an external group and a team" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Members" organization permissions (write)
"Remove the connection between an external group and a team" のパラメーター
| 名前, Type, 説明 | 
|---|
| acceptstringSetting to  | 
| 名前, Type, 説明 | 
|---|
| orgstring 必須The organization name. The name is not case sensitive. | 
| team_slugstring 必須The slug of the team name. | 
"Remove the connection between an external group and a team" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
| 204 | No Content | 
"Remove the connection between an external group and a team" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com を api.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
  -X DELETE \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groupsResponse
Status: 204