Team の同期
Team synchronization API では、GitHub Team と外部アイデンティティプロバイダ (IdP) グループとの間の接続を管理できます。
Team synchronization APIについて
この API を使用するには、認証されたユーザーがチームメンテナまたは Team に関連づけられた Organization のコードオーナーである必要があります。 また、認証に使用するトークンも、お使いの IdP (SSO) プロバイダーで使用するための認可を受けている必要があります。 詳しい情報についてはSAML シングルサインオンの Organization で使うために個人アクセストークンを認可するを参照してください。
Team 同期を使用して、IdPを通じて GitHubTeamメンバーを管理できます。 Team Synchronization API を使用するには、チーム同期が有効である必要があります。 詳しい情報については「アイデンティティプロバイダとGitHub間でのTeamの同期」を参照してください。
ノート: Team Synchronization APIはEntepriseで管理されているユーザとともに利用することはできません。 管理されたユーザを持つOrganizationの管理についてさらに学ぶには、「外部グループAPI」を参照してください。
List IdP groups for an organization
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 available in an organization. You can limit your page results using the per_page parameter. GitHub 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."
パラメータ
| Headers |
|---|
| 名前, 種類, 説明 |
acceptstringSetting to |
| Path parameters |
| 名前, 種類, 説明 |
orgstring必須The organization name. The name is not case sensitive. |
| クエリパラメータ |
| 名前, 種類, 説明 |
per_pageintegerThe number of results per page (max 100). デフォルト: |
pagestringPage token |
HTTP response status codes
| Status code | 説明 |
|---|---|
200 | OK |
コードサンプル
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/orgs/ORG/team-sync/groupsResponse
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
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.
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.
パラメータ
| Headers |
|---|
| 名前, 種類, 説明 |
acceptstringSetting to |
| Path parameters |
| 名前, 種類, 説明 |
orgstring必須The organization name. The name is not case sensitive. |
team_slugstring必須The slug of the team name. |
HTTP response status codes
| Status code | 説明 |
|---|---|
200 | OK |
コードサンプル
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/team-sync/group-mappingsResponse
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
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.
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.
パラメータ
| Headers | |||||||
|---|---|---|---|---|---|---|---|
| 名前, 種類, 説明 | |||||||
acceptstringSetting to | |||||||
| Path parameters | |||||||
| 名前, 種類, 説明 | |||||||
orgstring必須The organization name. The name is not case sensitive. | |||||||
team_slugstring必須The slug of the team name. | |||||||
| Body parameters | |||||||
| 名前, 種類, 説明 | |||||||
groupsarray of objectsThe IdP groups you want to connect to a GitHub team. When updating, the new | |||||||
Properties of the | |||||||
| 名前, 種類, 説明 |
|---|
group_idstring必須ID of the IdP group. |
group_namestring必須Name of the IdP group. |
group_descriptionstring必須Description of the IdP group. |
HTTP response status codes
| Status code | 説明 |
|---|---|
200 | OK |
コードサンプル
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
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.
パラメータ
| Headers |
|---|
| 名前, 種類, 説明 |
acceptstringSetting to |
| Path parameters |
| 名前, 種類, 説明 |
team_idinteger必須The unique identifier of the team. |
HTTP response status codes
| Status code | 説明 |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
コードサンプル
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/teams/TEAM_ID/team-sync/group-mappingsResponse
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.
パラメータ
| Headers | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 名前, 種類, 説明 | ||||||||||
acceptstringSetting to | ||||||||||
| Path parameters | ||||||||||
| 名前, 種類, 説明 | ||||||||||
team_idinteger必須The unique identifier of the team. | ||||||||||
| Body parameters | ||||||||||
| 名前, 種類, 説明 | ||||||||||
groupsarray of objects必須The IdP groups you want to connect to a GitHub team. When updating, the new | ||||||||||
Properties of the | ||||||||||
| 名前, 種類, 説明 |
|---|
group_idstring必須ID of the IdP group. |
group_namestring必須Name of the IdP group. |
group_descriptionstring必須Description of the IdP group. |
idstring |
namestring |
descriptionstring |
synced_atstringHTTP response status codes
| Status code | 説明 |
|---|---|
200 | OK |
403 | Forbidden |
422 | Validation failed |
コードサンプル
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
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."
}
]
}