チーム同期用の REST API エンドポイント
REST API を使って、GitHub Enterprise Cloud チームと外部 ID プロバイダー (IdP) グループの間の接続を管理します。
Team の同期について
これらのエンドポイントを使うには、認証されたユーザーが、チーム メンテナーであるか、またはチームに関連づけられた組織の所有者である必要があります。 また、認証に使用するトークンも、お使いの IdP (SSO) プロバイダーで使用するための認可を受けている必要があります。 詳しくは、「SAMLシングルサインオンで利用するために個人アクセストークンを認可する」を参照してください。
チームの同期を使って、IdP から GitHub Enterprise Cloud チームのメンバーを管理できます。 これらのエンドポイントを使うには、チームの同期を有効にする必要があります。 詳しくは、「Organization の Team 同期を管理する」を参照してください。
注: これらのエンドポイントは、Enterprise Managed Users では使えません。 マネージド ユーザーを含む Organization の管理の詳細については、「外部グループの REST API エンドポイント」を参照してください。
List IdP groups for an organization
Lists IdP groups available in an organization.
"List IdP groups for an organization" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Members" organization permissions (write)
"List IdP groups for an organization" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
org string 必須The organization name. The name is not case sensitive. |
名前, Type, 説明 |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
page string Page token |
q string Filters the results to return only those that begin with the value specified by this parameter. For example, a value of |
"List IdP groups for an organization" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | OK |
"List IdP groups for an organization" のコード サンプル
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at 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/team-sync/groups
Response
List IdP groups for a team
List IdP groups connected to a team on GitHub Enterprise Cloud.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Note
You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings
.
"List IdP groups for a team" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
org string 必須The organization name. The name is not case sensitive. |
team_slug string 必須The slug of the team name. |
"List IdP groups for a team" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | OK |
"List IdP groups for a team" のコード サンプル
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at 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/team-sync/group-mappings
Response
Create or update IdP group connections
Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty groups
array will remove all connections for a team.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Note
You can also specify a team by org_id
and team_id
using the route PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings
.
"Create or update IdP group connections" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
org string 必須The organization name. The name is not case sensitive. |
team_slug string 必須The slug of the team name. |
名前, Type, 説明 | ||||
---|---|---|---|---|
groups array of objects The IdP groups you want to connect to a GitHub team. When updating, the new | ||||
Properties of |
名前, Type, 説明 |
---|
group_id string 必須ID of the IdP group. |
group_name string 必須Name of the IdP group. |
group_description string 必須Description of the IdP group. |
"Create or update IdP group connections" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | OK |
"Create or update IdP group connections" のコード サンプル
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at 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/team-sync/group-mappings \
-d '{"groups":[{"group_id":"123","group_name":"Octocat admins","group_description":"string"}]}'
Response
List IdP groups for a team (Legacy)
Warning
Endpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new List IdP groups for a team
endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
List IdP groups connected to a team on GitHub Enterprise Cloud.
"List IdP groups for a team (Legacy)" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
team_id integer 必須The unique identifier of the team. |
"List IdP groups for a team (Legacy)" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
"List IdP groups for a team (Legacy)" のコード サンプル
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at 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/teams/TEAM_ID/team-sync/group-mappings
Response
Create or update IdP group connections (Legacy)
Warning
Endpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new Create or update IdP group connections
endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty groups
array will remove all connections for a team.
"Create or update IdP group connections (Legacy)" のパラメーター
名前, Type, 説明 |
---|
accept string Setting to |
名前, Type, 説明 |
---|
team_id integer 必須The unique identifier of the team. |
名前, Type, 説明 | |||||||
---|---|---|---|---|---|---|---|
groups array of objects 必須The IdP groups you want to connect to a GitHub team. When updating, the new | |||||||
Properties of |
名前, Type, 説明 |
---|
group_id string 必須ID of the IdP group. |
group_name string 必須Name of the IdP group. |
group_description string 必須Description of the IdP group. |
id string |
name string |
description string |
synced_at
string "Create or update IdP group connections (Legacy)" の HTTP 応答状態コード
状態コード | 説明 |
---|---|
200 | OK |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
"Create or update IdP group connections (Legacy)" のコード サンプル
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at 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/teams/TEAM_ID/team-sync/group-mappings \
-d '{"groups":[{"group_id":"123","group_name":"Octocat admins","description":"The people who configure your octoworld.","group_description":"string"}]}'
Response