Skip to main content
REST API теперь версия. Дополнительные сведения см. в разделе "О управлении версиями API".

Конечные точки REST API для проверки корпоративного доступа

Используйте REST API для управления конфигурацией проверки корпоративного доступа в организации GitHub предприятия.

Disable access restrictions for an enterprise

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

Детализированные токены доступа для «Disable access restrictions for an enterprise»

Эта конечная точка не работает с пользовательскими токенами доступа GitHub App, токенами доступа для установки GitHub App или детализированными персональными токенами доступа.

Параметры для «Disable access restrictions for an enterprise»

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name.

HTTP-коды статуса ответа для «Disable access restrictions for an enterprise»

Код состоянияDescription
200

OK

400

Forbidden

404

Resource not found

500

Internal Error

Примеры кода для «Disable access restrictions for an enterprise»

Если вы получаете доступ к GitHub на GHE.com, замените api.github.com на выделенный поддомен вашего предприятия в api.SUBDOMAIN.ghe.com.

Пример запроса

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: 2026-03-10" \ 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.

Детализированные токены доступа для «Enable access restrictions for an enterprise»

Эта конечная точка не работает с пользовательскими токенами доступа GitHub App, токенами доступа для установки GitHub App или детализированными персональными токенами доступа.

Параметры для «Enable access restrictions for an enterprise»

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name.

HTTP-коды статуса ответа для «Enable access restrictions for an enterprise»

Код состоянияDescription
200

OK

400

Forbidden

404

Resource not found

500

Internal Error

Примеры кода для «Enable access restrictions for an enterprise»

Если вы получаете доступ к GitHub на GHE.com, замените api.github.com на выделенный поддомен вашего предприятия в api.SUBDOMAIN.ghe.com.

Пример запроса

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: 2026-03-10" \ 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" }