Skip to main content
REST API はバージョン管理になりました。 詳細については、「API のバージョン管理について」を参照してください。

チーム同期用の 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:write

"List IdP groups for an organization" のパラメーター

ヘッダー
名前, Type, 説明
accept string

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

パス パラメーター
名前, 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: 30

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 ab will return results that begin with "ab".

"List IdP groups for an organization" の HTTP 応答状態コード

状態コード説明
200

OK

"List IdP groups for an organization" のコード サンプル

要求の例

get/orgs/{org}/team-sync/groups
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 application/vnd.github+json is recommended.

パス パラメーター
名前, 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" のコード サンプル

要求の例

get/orgs/{org}/teams/{team_slug}/team-sync/group-mappings
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 application/vnd.github+json is recommended.

パス パラメーター
名前, 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 groups object will replace the original one. You must include any existing groups that you don't want to remove.

名前, 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" のコード サンプル

要求の例

patch/orgs/{org}/teams/{team_slug}/team-sync/group-mappings
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 application/vnd.github+json is recommended.

パス パラメーター
名前, 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)" のコード サンプル

要求の例

get/teams/{team_id}/team-sync/group-mappings
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 application/vnd.github+json is recommended.

パス パラメーター
名前, 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 groups object will replace the original one. You must include any existing groups that you don't want to remove.

名前, 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)" のコード サンプル

要求の例

patch/teams/{team_id}/team-sync/group-mappings
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." } ] }