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

Enterprise チーム メンバーの REST API エンドポイント

REST API を使って、GitHub Enterprise 内の Enterprise チームを作成および管理します。

Enterprise チームについて

メモ

現在、このエンドポイントは パブリック プレビュー 段階であり、変更される可能性があります。

この API ドキュメントは、GitHub Enterprise Cloud 上の Enterprise を対象としています。

Enterprise が GHE を利用していない Copilot Business である場合は、以前に共有された早期アクセス用ドキュメント リンクを参照してください。

これらのエンドポイントは、GET API の場合は read:enterprise スコープ、その他の API の場合は admin:enterprise であり、クラシック personal access tokens を利用する Enterprise チームの Enterprise に属する認証済みメンバーのみが使用できます。

これらのエンドポイントは、fine-grained personal access tokens または GitHub App アクセス トークンと互換性がありません。

GitHub により、チーム name から Enterprise チームの slug が生成され、ent: プレフィックスが追加されます。

List enterprise teams

List all teams in the enterprise for the authenticated user

"List enterprise teams" のきめ細かいアクセス トークン

このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。

"List enterprise teams" のパラメーター

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

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

パス パラメーター
名前, Type, 説明
enterprise string 必須

The slug version of the enterprise name.

クエリ パラメーター
名前, 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 integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Default: 1

"List enterprise teams" の HTTP 応答状態コード

状態コード説明
200

OK

403

Forbidden

"List enterprise teams" のコード サンプル

GHE.com で GitHub にアクセスする場合は、api.github.comapi.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。

要求の例

get/enterprises/{enterprise}/teams
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/enterprises/ENTERPRISE/teams

Response

Status: 200
[ { "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" } ]

Create an enterprise team

To create an enterprise team, the authenticated user must be an owner of the enterprise.

"Create an enterprise team" のきめ細かいアクセス トークン

このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。

"Create an enterprise team" のパラメーター

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

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

パス パラメーター
名前, Type, 説明
enterprise string 必須

The slug version of the enterprise name.

本文のパラメーター
名前, Type, 説明
name string 必須

The name of the team.

description string or null

A description of the team.

sync_to_organizations string

Retired: this field is no longer supported. Whether the enterprise team should be reflected in each organization. This value cannot be set.

Default: disabled

次のいずれかにできます: all, disabled

organization_selection_type string

Specifies which organizations in the enterprise should have access to this team. Can be one of disabled, selected, or all. disabled: The team is not assigned to any organizations. This is the default when you create a new team. selected: The team is assigned to specific organizations. You can then use the add organization assignments API endpoint. all: The team is assigned to all current and future organizations in the enterprise.

Default: disabled

次のいずれかにできます: disabled, selected, all

group_id string or null

The ID of the IdP group to assign team membership with. You can get this value from the REST API endpoints for SCIM.

"Create an enterprise team" の HTTP 応答状態コード

状態コード説明
201

Created

"Create an enterprise team" のコード サンプル

GHE.com で GitHub にアクセスする場合は、api.github.comapi.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。

要求の例

post/enterprises/{enterprise}/teams
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/enterprises/ENTERPRISE/teams \ -d '{"name":"Justice League","description":"A great team.","group_id":"62ab9291-fae2-468e-974b-7e45096d5021"}'

Response

Status: 201
[ { "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" } ]

Get an enterprise team

Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a - separator and adds the "ent:" prefix. For example, "My TEam Näme" would become ent:my-team-name.

"Get an enterprise team" のきめ細かいアクセス トークン

このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。

"Get an enterprise team" のパラメーター

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

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

パス パラメーター
名前, Type, 説明
enterprise string 必須

The slug version of the enterprise name.

team_slug string 必須

The slug of the team name.

"Get an enterprise team" の HTTP 応答状態コード

状態コード説明
200

OK

403

Forbidden

"Get an enterprise team" のコード サンプル

GHE.com で GitHub にアクセスする場合は、api.github.comapi.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。

要求の例

get/enterprises/{enterprise}/teams/{team_slug}
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/enterprises/ENTERPRISE/teams/TEAM_SLUG

Response

Status: 200
[ { "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" } ]

Update an enterprise team

To edit a team, the authenticated user must be an enterprise owner.

"Update an enterprise team" のきめ細かいアクセス トークン

このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。

"Update an enterprise team" のパラメーター

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

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

パス パラメーター
名前, Type, 説明
enterprise string 必須

The slug version of the enterprise name.

team_slug string 必須

The slug of the team name.

本文のパラメーター
名前, Type, 説明
name string or null

A new name for the team.

description string or null

A new description for the team.

sync_to_organizations string

Retired: this field is no longer supported. Whether the enterprise team should be reflected in each organization. This value cannot be changed.

Default: disabled

次のいずれかにできます: all, disabled

organization_selection_type string

Specifies which organizations in the enterprise should have access to this team. Can be one of disabled, selected, or all. disabled: The team is not assigned to any organizations. This is the default when you create a new team. selected: The team is assigned to specific organizations. You can then use the add organization assignments API. all: The team is assigned to all current and future organizations in the enterprise.

Default: disabled

次のいずれかにできます: disabled, selected, all

group_id string or null

The ID of the IdP group to assign team membership with. The new IdP group will replace the existing one, or replace existing direct members if the team isn't currently linked to an IdP group.

"Update an enterprise team" の HTTP 応答状態コード

状態コード説明
200

OK

403

Forbidden

"Update an enterprise team" のコード サンプル

GHE.com で GitHub にアクセスする場合は、api.github.comapi.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。

要求の例

patch/enterprises/{enterprise}/teams/{team_slug}
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/enterprises/ENTERPRISE/teams/TEAM_SLUG \ -d '{"name":"Justice League","description":"A great team.","group_id":"62ab9291-fae2-468e-974b-7e45096d5021"}'

Response

Status: 200
[ { "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" } ]

Delete an enterprise team

To delete an enterprise team, the authenticated user must be an enterprise owner.

If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well.

"Delete an enterprise team" のきめ細かいアクセス トークン

このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。

"Delete an enterprise team" のパラメーター

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

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

パス パラメーター
名前, Type, 説明
enterprise string 必須

The slug version of the enterprise name.

team_slug string 必須

The slug of the team name.

"Delete an enterprise team" の HTTP 応答状態コード

状態コード説明
204

No Content

403

Forbidden

"Delete an enterprise team" のコード サンプル

GHE.com で GitHub にアクセスする場合は、api.github.comapi.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。

要求の例

delete/enterprises/{enterprise}/teams/{team_slug}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/enterprises/ENTERPRISE/teams/TEAM_SLUG

Response

Status: 204