Points de terminaison de l’API REST pour la vérification de l’accès à l’entreprise
Utilisez l’API REST pour gérer la configuration de la vérification de l’accès à l’entreprise dans votre entreprise GitHub.
Disable access restrictions for an enterprise
Disable access restriction by proxy header using the network proxy owned by the enterprise.
Jetons d'accès granulaires pour «Disable access restrictions for an enterprise»
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour «Disable access restrictions for an enterprise »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
enterprise string RequisThe slug version of the enterprise name. |
Codes d’état de réponse HTTP pour «Disable access restrictions for an enterprise »
| Code de statut | Description |
|---|---|
200 | OK |
400 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Exemples de code pour «Disable access restrictions for an enterprise »
Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.
Exemple de requête
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.
Jetons d'accès granulaires pour «Enable access restrictions for an enterprise»
Ce point de terminaison ne fonctionne pas avec les jetons d’accès utilisateur d’application GitHub, les jetons d’accès d’installation d’application GitHub ou les jetons d’accès personnels affinés.
Paramètres pour «Enable access restrictions for an enterprise »
| Nom, Type, Description |
|---|
accept string Setting to |
| Nom, Type, Description |
|---|
enterprise string RequisThe slug version of the enterprise name. |
Codes d’état de réponse HTTP pour «Enable access restrictions for an enterprise »
| Code de statut | Description |
|---|---|
200 | OK |
400 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Exemples de code pour «Enable access restrictions for an enterprise »
Si vous accédez à GitHub à GHE.com, remplacez api.github.com par le sous-domaine dédié de votre entreprise à api.SUBDOMAIN.ghe.com.
Exemple de requête
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"
}