Endpoints da API REST para verificação de acesso corporativo
Use a API REST para gerenciar a configuração da verificação de acesso corporativo em sua empresa no GitHub.
Disable access restrictions for an enterprise
Disable access restriction by proxy header using the network proxy owned by the enterprise.
Tokens de acesso granulares para "Disable access restrictions for an enterprise"
Esse ponto de extremidade não funciona com tokens de acesso de usuário do GitHub App, tokens de acesso de instalação do GitHub App ou tokens de acesso pessoal com controle refinado.
Parâmetros para "Disable access restrictions for an enterprise"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
enterprise string ObrigatórioThe slug version of the enterprise name. |
Códigos de status de resposta HTTP para "Disable access restrictions for an enterprise"
| Código de status | Descriçã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 GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/access-restrictions/disableResponse
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 granulares para "Enable access restrictions for an enterprise"
Esse ponto de extremidade não funciona com tokens de acesso de usuário do GitHub App, tokens de acesso de instalação do GitHub App ou tokens de acesso pessoal com controle refinado.
Parâmetros para "Enable access restrictions for an enterprise"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
enterprise string ObrigatórioThe slug version of the enterprise name. |
Códigos de status de resposta HTTP para "Enable access restrictions for an enterprise"
| Código de status | Descriçã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 GitHub em GHE.com, substitua api.github.com pelo subdomínio dedicado da sua empresa em api.SUBDOMAIN.ghe.com.
Exemplo de solicitação
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/access-restrictions/enableResponse
Status: 200{
"message": "Enterprise access restrictions successfully enabled.",
"header_name": "sec-GitHub-allowed-enterprise",
"header_value": "12345"
}