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

GitHub Actions Permissions

The GitHub Actions Permissions API allows you to set permissions for what enterprises, organizations, and repositories are allowed to run GitHub Actions, and what actions and reusable workflows are allowed to run.

About the Permissions API

The GitHub Actions Permissions API allows you to set permissions for what enterprises, organizations, and repositories are allowed to run GitHub Actions, and what actions and reusable workflows are allowed to run. For more information, see "Usage limits, billing, and administration."

Get GitHub Actions permissions for an enterprise

Gets the GitHub Actions permissions policy for organizations and allowed actions and reusable workflows in an enterprise.

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

Parameters

Headers
Name, Type, Description
acceptstring

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

Path parameters
Name, Type, Description
enterprisestringRequired

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

HTTP response status codes

Status codeDescription
200

OK

Code samples

get/enterprises/{enterprise}/actions/permissions
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://api.github.com/enterprises/ENTERPRISE/actions/permissions

Response

Status: 200
{ "enabled_organizations": "all", "allowed_actions": "selected", "selected_actions_url": "https://api.github.com/enterprises/2/actions/permissions/selected-actions" }

Set GitHub Actions permissions for an enterprise

Sets the GitHub Actions permissions policy for organizations and allowed actions and reusable workflows in an enterprise.

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

Parameters

Headers
Name, Type, Description
acceptstring

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

Path parameters
Name, Type, Description
enterprisestringRequired

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Body parameters
Name, Type, Description
enabled_organizationsstringRequired

The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions.

Can be one of: all, none, selected

allowed_actionsstring

The permissions policy that controls the actions and reusable workflows that are allowed to run.

Can be one of: all, local_only, selected

HTTP response status codes

Status codeDescription
204

No Content

Code samples

put/enterprises/{enterprise}/actions/permissions
curl \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://api.github.com/enterprises/ENTERPRISE/actions/permissions \ -d '{"enabled_organizations":"all","allowed_actions":"selected"}'

Response

Status: 204

List 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."

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

Parameters

Headers
Name, Type, Description
acceptstring

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

Path parameters
Name, Type, Description
enterprisestringRequired

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Query parameters
Name, Type, Description
per_pageinteger

The number of results per page (max 100).

Default: 30

pageinteger

Page number of the results to fetch.

Default: 1

HTTP response status codes

Status codeDescription
200

OK

Code samples

get/enterprises/{enterprise}/actions/permissions/organizations
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://api.github.com/enterprises/ENTERPRISE/actions/permissions/organizations

Response

Status: 200
{ "total_count": 1, "organizations": [ { "login": "octocat", "id": 161335, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2