Skip to main content
O controle de versão da API REST já foi feito. Para obter mais informações, confira "Sobre o controle de versão da API".

REST API endpoints for enterprise access verification

Use the REST API to manage enterprise access verification configuration in your GitHub enterprise.

Disable access restrictions for an enterprise

Disable access restriction by proxy header using the network proxy owned by the enterprise.

Tokens de acesso refinados para "Disable access restrictions for an enterprise"

Esse ponto de extremidade não funciona com tokens de acesso de usuário do aplicativo GitHub, tokens de acesso de instalação do aplicativo GitHub ou tokens de acesso pessoal refinados.

Parâmetros para "Disable access restrictions for an enterprise"

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

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

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

The slug version of the enterprise name.

Códigos de status de resposta HTTP para "Disable access restrictions for an enterprise"

Código de statusDescrição
200

OK

400

Forbidden

404

Resource not found

500

Internal Error

Exemplos de código para "Disable access restrictions for an enterprise"

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

Exemplo de solicitação

post/enterprises/{enterprise}/access-restrictions/disable
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/access-restrictions/disable

Response

Status: 200
{ "message": "Enterprise access restrictions successfully disabled.", "header_name": "sec-GitHub-allowed-enterprise", "header_value": "12345" }

Enable access restrictions for an enterprise

Enable access restriction by proxy header using the network proxy owned by the enterprise.

Tokens de acesso refinados para "Enable access restrictions for an enterprise"

Esse ponto de extremidade não funciona com tokens de acesso de usuário do aplicativo GitHub, tokens de acesso de instalação do aplicativo GitHub ou tokens de acesso pessoal refinados.

Parâmetros para "Enable access restrictions for an enterprise"

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

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

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

The slug version of the enterprise name.

Códigos de status de resposta HTTP para "Enable access restrictions for an enterprise"

Código de statusDescrição
200

OK

400

Forbidden

404

Resource not found

500

Internal Error

Exemplos de código para "Enable access restrictions for an enterprise"

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

Exemplo de solicitação

post/enterprises/{enterprise}/access-restrictions/enable
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/access-restrictions/enable

Response

Status: 200
{ "message": "Enterprise access restrictions successfully enabled.", "header_name": "sec-GitHub-allowed-enterprise", "header_value": "12345" }