Skip to main content

Team の同期

Team synchronization API では、GitHub Enterprise Cloud Team と外部アイデンティティプロバイダ (IdP) グループとの間の接続を管理できます。

Team synchronization APIについて

この API を使用するには、認証されたユーザーがチームメンテナまたは Team に関連づけられた Organization のコードオーナーである必要があります。 また、認証に使用するトークンも、お使いの IdP (SSO) プロバイダーで使用するための認可を受けている必要があります。 詳しい情報についてはSAML シングルサインオンの Organization で使うために個人アクセストークンを認可するを参照してください。

Team 同期を使用して、IdPを通じて GitHubTeamメンバーを管理できます。 Team Synchronization API を使用するには、チーム同期が有効である必要があります。 詳しい情報については「アイデンティティプロバイダとGitHub間でのTeamの同期」を参照してください。

ノート: Team Synchronization APIはEnterprise Managed Usersとともに利用することはできません。 managed usersを持つOrganizationの管理についてさらに学ぶには、「外部グループAPI」を参照してください。

List IdP groups for an organization

Works with GitHub Apps

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
名前, 種類, 説明
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
名前, 種類, 説明
orgstring必須

The organization name. The name is not case sensitive.

クエリパラメータ
名前, 種類, 説明
per_pageinteger

The number of results per page (max 100).

デフォルト: 30

pagestring

Page token

HTTP response status codes

Status code説明
200

OK

コードサンプル

get/orgs/{org}/team-sync/groups
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ 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

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
名前, 種類, 説明
acceptstring

Setting to application/vnd.github+json is recommended.

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

コードサンプル

get/orgs/{org}/teams/{team_slug}/team-sync/group-mappings
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ 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

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
名前, 種類, 説明
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
名前, 種類, 説明
orgstring必須

The organization name. The name is not case sensitive.

team_slugstring必須

The slug of the team name.

Body parameters
名前, 種類, 説明
groupsarray of objects

The IdP groups you want to connect to a GitHub team. When updating, the new groups object will replace the original one. You must include any existing groups that you don't want to remove.

名前, 種類, 説明
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

コードサンプル

patch/orgs/{org}/teams/{team_slug}/team-sync/group-mappings
curl \ -X PATCH \ -H "Accept: application/vnd.github+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
名前, 種類, 説明
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
名前, 種類, 説明
team_idinteger必須

The unique identifier of the team.

HTTP response status codes

Status code説明
200

OK

403

Forbidden

404

Resource not found

コードサンプル

get/teams/{team_id}/team-sync/group-mappings
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ 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.

パラメータ

Headers
名前, 種類, 説明
acceptstring

Setting to application/vnd.github+json is recommended.

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 groups object will replace the original one. You must include any existing groups that you don't want to remove.

名前, 種類, 説明
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_atstring

HTTP response status codes

Status code説明
200

OK

403

Forbidden

422

Validation failed

コードサンプル

patch/teams/{team_id}/team-sync/group-mappings
curl \ -X PATCH \ -H "Accept: application/vnd.github+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." } ] }