Team の同期
REST API を使って、GitHub Enterprise Cloud チームと外部 ID プロバイダー (IdP) グループの間の接続を管理します。
Team の同期について
これらのエンドポイントを使うには、認証されたユーザーが、チーム メンテナーであるか、またはチームに関連づけられた組織の所有者である必要があります。 また、認証に使用するトークンも、お使いの IdP (SSO) プロバイダーで使用するための認可を受けている必要があります。 詳しくは、「SAMLシングルサインオンで利用するために個人アクセストークンを認可する」を参照してください。
チームの同期を使って、IdP から GitHub Enterprise Cloud チームのメンバーを管理できます。 これらのエンドポイントを使うには、チームの同期を有効にする必要があります。 詳しくは、「Organization の Team 同期を管理する」を参照してください。
注: これらのエンドポイントは、Enterprise Managed Users では使えません。 マネージド ユーザーを含む Organization の管理の詳細については、「外部グループ」を参照してください。
List IdP groups for an organization
Lists IdP groups available in an organization.
"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). 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" のコード サンプル
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
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
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" のコード サンプル
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
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
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" のコード サンプル
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
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
List IdP groups for a team (Legacy)
Deprecation Notice: This endpoint route is deprecated 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)" のコード サンプル
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
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
Create or update IdP group connections (Legacy)
Deprecation Notice: This endpoint route is deprecated 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)" のコード サンプル
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
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
}
]
}