This version of GitHub Enterprise Server will be discontinued on 2026-09-22. Discontinued releases are not supported. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features in GitHub Enterprise Server, see Overview of the upgrade process. For help with the upgrade, GitHub Enterprise Support.
REST API endpoints for GitHub Actions permissions
Use the REST API to interact with permissions for GitHub Actions.
About permissions for GitHub Actions
You can use the REST API to set permissions for the enterprises, organizations and repositories that are allowed to run GitHub Actions, and the actions that are allowed to run. For more information, see Enforcing policies for GitHub Actions in your enterprise, Disabling or limiting GitHub Actions for your organization, and Managing GitHub Actions settings for a repository.
Get GitHub Actions permissions for an enterprise
Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.
OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.
Fine-grained access tokens for "Get GitHub Actions permissions 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 "Get GitHub Actions permissions for an enterprise"
| Name, Type, Description |
|---|
accept string Setting to |
| Name, Type, Description |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
HTTP response status codes for "Get GitHub Actions permissions for an enterprise"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get GitHub Actions permissions for an enterprise"
Request example
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissionsResponse
Status: 200{
"enabled_organizations": "all",
"allowed_actions": "selected",
"selected_actions_url": "https://HOSTNAME/enterprises/2/actions/permissions/selected-actions"
}Set GitHub Actions permissions for an enterprise
Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.
OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.
Fine-grained access tokens for "Set GitHub Actions permissions 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 "Set GitHub Actions permissions for an enterprise"
| Name, Type, Description |
|---|
accept string Setting to |
| Name, Type, Description |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
| Name, Type, Description |
|---|
enabled_organizations string RequiredThe policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: |
allowed_actions string The permissions policy that controls the actions that are allowed to run. Can be one of: |
HTTP response status codes for "Set GitHub Actions permissions for an enterprise"
| Status code | Description |
|---|---|
204 | No Content |
Code samples for "Set GitHub Actions permissions for an enterprise"
Request example
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions \
-d '{"enabled_organizations":"all","allowed_actions":"selected"}'Response
Status: 204List selected organizations enabled for GitHub Actions in an enterprise
Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations must be configured to selected. For more information, see "Set GitHub Actions permissions for an enterprise."
OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.
Fine-grained access tokens for "List selected organizations enabled for GitHub Actions in 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 "List selected organizations enabled for GitHub Actions in an enterprise"
| Name, Type, Description |
|---|
accept string Setting to |
| Name, Type, Description |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
| Name, Type, Description |
|---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Default: |
HTTP response status codes for "List selected organizations enabled for GitHub Actions in an enterprise"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "List selected organizations enabled for GitHub Actions in an enterprise"
Request example
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/permissions/organizationsResponse
Status: 200{
"total_count": 1,
"organizations": [
{
"login": "octocat",
"id": 161335,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"url": "https://HOSTNAME/orgs/octo-org",
"repos_url": "https://HOSTNAME/orgs/octo-org/repos",
"events_url": "https://HOSTNAME/orgs/octo-org/events",
"hooks_url": "https://HOSTNAME/orgs/octo-org/hooks",
"issues_url": "https://HOSTNAME/orgs/octo-org/issues",
"members_url": "https://HOSTNAME/orgs/octo-org/members{/member}",
"public_members_url": "https://HOSTNAME/orgs/octo-org/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}
]
}Set selected organizations enabled for GitHub Actions in an enterprise
Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations must be configured to selected. For more information, see "Set GitHub Actions permissions for an enterprise."
OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.
Fine-grained access tokens for "Set selected organizations enabled for GitHub Actions in 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 "Set selected organizations enabled for GitHub Actions in an enterprise"
| Name, Type, Description |
|---|
accept string Setting to |
| Name, Type, Description |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
| Name, Type, Description |
|---|
selected_organization_ids array of integers |