Skip to main content
Skip to content

REST API endpoints for Copilot team customizations

Use the REST API to manage Copilot customizations for a team.

Get Copilot customizations for a team

Note

This endpoint is in public preview and is subject to change.

Gets the GitHub-managed Copilot customizations of a team.

The authenticated user must be an organization owner or a team maintainer. Teams that keep their customizations in a repository return 409.

OAuth app tokens and personal access tokens (classic) need the admin:org or read:org scope to use this endpoint.

“Get Copilot customizations for a team”的细粒度访问令牌

此端点支持以下精细令牌类型:

细粒度令牌必须具有以下权限集:

  • "Copilot agent settings" organization permissions (read)

“”Get Copilot customizations for a team 的参数

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
org string 必须

The organization name. The name is not case sensitive.

team_slug string 必须

The slug of the team name.

“Get Copilot customizations for a team”的 HTTP 响应状态代码

状态代码说明
200

OK

401

Requires authentication

403

Forbidden

404

Resource not found

409

Conflict

422

Validation failed, or the endpoint has been spammed.

500

Internal Error

503

Service unavailable

“Get Copilot customizations for a team”的代码示例

如果你在 GHE.com 上访问 GitHub,请将 api.github.com 替换为企业的专用子域,位于 api.SUBDOMAIN.ghe.com。

请求示例

get/orgs/{org}/teams/{team_slug}/copilot/customizations
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/copilot/customizations

Response

Status: 200
{ "pluginAssignments": { "code-review@acme-marketplace": { "state": "defaultEnabled" } }, "extraKnownMarketplaces": { "acme-marketplace": { "source": { "source": "github", "repo": "acme/copilot-marketplace" } } } }

Set Copilot customizations for a team

Note

This endpoint is in public preview and is subject to change.

Replaces the GitHub-managed Copilot customizations of a team, creating them on the first write.

The authenticated user must be an organization owner or a team maintainer. Teams that keep their customizations in a repository return 409. Documents that fail validation return 422 with the reason.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

“Set Copilot customizations for a team”的细粒度访问令牌

此端点支持以下精细令牌类型:

细粒度令牌必须具有以下权限集:

  • "Copilot agent settings" organization permissions (write)

“”Set Copilot customizations for a team 的参数

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
org string 必须

The organization name. The name is not case sensitive.

team_slug string 必须

The slug of the team name.

主体参数
名称, 类型, 说明
pluginAssignments object

Plugins assigned to the team, keyed by PLUGIN@MARKETPLACE.

名称, 类型, 说明
key object

A user-defined key to represent an item in pluginAssignments.

名称, 类型, 说明
state string

The assignment state.

值: defaultEnabled

extraKnownMarketplaces object

Additional plugin marketplaces available to the team, keyed by marketplace name.

名称, 类型, 说明
key object

A user-defined key to represent an item in extraKnownMarketplaces.

“Set Copilot customizations for a team”的 HTTP 响应状态代码

状态代码说明
200

OK

401

Requires authentication

403

Forbidden

404

Resource not found

409

Conflict

422

Validation failed, or the endpoint has been spammed.

500

Internal Error

503

Service unavailable

“Set Copilot customizations for a team”的代码示例

如果你在 GHE.com 上访问 GitHub,请将 api.github.com 替换为企业的专用子域,位于 api.SUBDOMAIN.ghe.com。

请求示例

put/orgs/{org}/teams/{team_slug}/copilot/customizations
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/copilot/customizations \ -d '{"pluginAssignments":{"code-review@acme-marketplace":{"state":"defaultEnabled"}},"extraKnownMarketplaces":{"acme-marketplace":{"source":{"source":"github","repo":"acme/copilot-marketplace"}}}}'

Response

Status: 200
{ "pluginAssignments": { "code-review@acme-marketplace": { "state": "defaultEnabled" } }, "extraKnownMarketplaces": { "acme-marketplace": { "source": { "source": "github", "repo": "acme/copilot-marketplace" } } } }

Delete Copilot customizations for a team

Note

This endpoint is in public preview and is subject to change.

Deletes the GitHub-managed Copilot customizations of a team. Deleting customizations that don't exist succeeds.

The authenticated user must be an organization owner or a team maintainer. Teams that keep their customizations in a repository return 409.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

“Delete Copilot customizations for a team”的细粒度访问令牌

此端点支持以下精细令牌类型:

细粒度令牌必须具有以下权限集:

  • "Copilot agent settings" organization permissions (write)

“”Delete Copilot customizations for a team 的参数

标头
名称, 类型, 说明
accept string

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

路径参数
名称, 类型, 说明
org string 必须

The organization name. The name is not case sensitive.

team_slug string 必须

The slug of the team name.

“Delete Copilot customizations for a team”的 HTTP 响应状态代码

状态代码说明
204

No Content

401

Requires authentication

403

Forbidden

404

Resource not found

409

Conflict

422

Validation failed, or the endpoint has been spammed.

500

Internal Error

503

Service unavailable

“Delete Copilot customizations for a team”的代码示例

如果你在 GHE.com 上访问 GitHub,请将 api.github.com 替换为企业的专用子域,位于 api.SUBDOMAIN.ghe.com。

请求示例

delete/orgs/{org}/teams/{team_slug}/copilot/customizations
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/copilot/customizations

Response

Status: 204