Skip to main content
Skip to content

endpoints da API REST para o gerenciamento de políticas de recursos do Copilot

Use a API REST para gerenciar Copilot políticas de funcionalidade de uma organização.

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.

Tokens de acesso granulares para "Get feature policies for an organization"

Este endpoint funciona com os seguintes tipos de token granulares:

O token refinado deve ter os seguintes conjuntos de permissões:

  • "Administration" organization permissions (write)

Parâmetros para "Get feature policies for an organization"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

Códigos de status de resposta HTTP para "Get feature policies for an organization"

Código de statusDescrição
200

OK

401

Requires authentication

403

Forbidden

404

Resource not found

Exemplos de código para "Get feature policies for an organization"

Se você acessar GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.

Exemplo de solicitação

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.

Tokens de acesso granulares para "Update feature policies for an organization"

Este endpoint funciona com os seguintes tipos de token granulares:

O token refinado deve ter os seguintes conjuntos de permissões:

  • "Administration" organization permissions (write)

Parâmetros para "Update feature policies for an organization"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

Parâmetros do corpo
Nome, Tipo, Descrição
default_availability object Obrigatório
Nome, Tipo, Descrição
policy_state string Obrigatório

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

Pode ser um dos: enabled, disabled

Códigos de status de resposta HTTP para "Update feature policies for an organization"

Código de statusDescrição
200

OK

401

Requires authentication

403

Forbidden

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

Exemplos de código para "Update feature policies for an organization"

Se você acessar GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.

Exemplo de solicitação

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 } }