Skip to main content
The REST API is now versioned. For more information, see "About API versioning."

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.

Fine-grained access tokens for "Disable access restrictions for an enterprise"

This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.

Parameters for "Disable access restrictions for an enterprise"

Headers
Name, Type, Description
accept string

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

Path parameters
Name, Type, Description
enterprise string Required

The slug version of the enterprise name.

HTTP response status codes for "Disable access restrictions for an enterprise"

Status codeDescription
200

OK

400

Forbidden

404

Resource not found

500

Internal Error

Code samples for "Disable access restrictions for an enterprise"

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Request example

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.

Fine-grained access tokens for "Enable access restrictions for an enterprise"

This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.

Parameters for "Enable access restrictions for an enterprise"

Headers
Name, Type, Description
accept string

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

Path parameters
Name, Type, Description
enterprise string Required

The slug version of the enterprise name.

HTTP response status codes for "Enable access restrictions for an enterprise"

Status codeDescription
200

OK

400

Forbidden

404

Resource not found

500

Internal Error

Code samples for "Enable access restrictions for an enterprise"

If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.

Request example

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