Skip to main content
Skip to content

Copilot機能ポリシー管理用の REST API エンドポイント

REST API を使用して、組織の Copilot 機能ポリシーを管理します。

Get feature policies for an organization

Note

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

Use this endpoint to retrieve the Copilot default availability policy for new features and clients for an organization.

The enterprise default is used when the enterprise has set one. Otherwise, the organization's own default is used, and an organization that has not enabled a default is reported as disabled. For more information, see About default availability.

Organization owners can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the admin:org or repo scope to use this endpoint. Organization SAML authorization and OAuth app access restrictions also apply.

"Get feature policies for an organization" のきめ細かいアクセス トークン

このエンドポイントは、次の粒度の細かいトークンの種類で動作します:

粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:

  • "Administration" organization permissions (write)

"Get feature policies for an organization" のパラメーター

ヘッダー
名前, タイプ, 説明
accept string

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

パスパラメーター
名前, タイプ, 説明
org string 必須

The organization name. The name is not case sensitive.

"Get feature policies for an organization" の HTTP 応答状態コード

状態コード説明
200

OK

401

Requires authentication

403

Forbidden

404

Resource not found

"Get feature policies for an organization" のコード サンプル

GHE.com でGitHubにアクセスする場合は、api.github.com を、api.SUBDOMAIN.ghe.com にある企業の専用サブドメインに置き換えます。

要求の例

get/orgs/{org}/copilot/feature-policies
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/copilot/feature-policies

OK

Status: 200
{ "default_availability": { "policy_state": "enabled", "editable": true } }

Update feature policies for an organization

Note

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

Use this endpoint to update the Copilot default availability policy for new features and clients for an organization.

An organization can only set its own default while its enterprise has not set one. For more information, see About default availability.

Changing this policy does not change any Copilot feature or client policy that has already been set.

Organization owners can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the admin:org or repo scope to use this endpoint. Organization SAML authorization and OAuth app access restrictions also apply.

"Update feature policies for an organization" のきめ細かいアクセス トークン

このエンドポイントは、次の粒度の細かいトークンの種類で動作します:

粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:

  • "Administration" organization permissions (write)

"Update feature policies for an organization" のパラメーター

ヘッダー
名前, タイプ, 説明
accept string

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

パスパラメーター
名前, タイプ, 説明
org string 必須

The organization name. The name is not case sensitive.

ボディパラメータ
名前, タイプ, 説明
default_availability object 必須
名前, タイプ, 説明
policy_state string 必須

The organization default policy applied to newly released Copilot features and clients.

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

"Update feature policies for an organization" の HTTP 応答状態コード

状態コード説明
200

OK

401

Requires authentication

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

"Update feature policies for an organization" のコード サンプル

GHE.com でGitHubにアクセスする場合は、api.github.com を、api.SUBDOMAIN.ghe.com にある企業の専用サブドメインに置き換えます。

要求の例

patch/orgs/{org}/copilot/feature-policies
curl -L \ -X PATCH \ -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/copilot/feature-policies \ -d '{"default_availability":{"policy_state":"enabled"}}'

OK

Status: 200
{ "default_availability": { "policy_state": "enabled", "editable": true } }