GitHub v3 REST API

Get GitHub Actions permissions for an enterprise

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

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

get
{protocol}://{hostname}/api/v3/enterprises/{enterprise}/actions/permissions

Path Parameters

enterprisestringrequired

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

Response

200 application/json

Response

actions-enterprise-permissions

enabled_organizationsstringrequired

The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: all, none, or selected.

Allowed values:allnoneselected

selected_organizations_urlstring

The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when enabled_organizations is set to selected.

allowed_actionsstring

The permissions policy that controls the actions that are allowed to run. Can be one of: all, local_only, or selected.

Allowed values:alllocal_onlyselected

selected_actions_urlstring

The API URL to use to get or set the actions that are allowed to run, when allowed_actions is set to selected.

get/enterprises/{enterprise}/actions/permissions
 
200 application/json

Set GitHub Actions permissions for an enterprise

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

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

put
{protocol}://{hostname}/api/v3/enterprises/{enterprise}/actions/permissions

Path Parameters

enterprisestringrequired

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

Body

application/json
enabled_organizationsstringrequired

The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: all, none, or selected.

Allowed values:allnoneselected

allowed_actionsstring

The permissions policy that controls the actions that are allowed to run. Can be one of: all, local_only, or selected.

Allowed values:alllocal_onlyselected

Response

204

Response

put/enterprises/{enterprise}/actions/permissions

Body

{ "enabled_organizations": "all", "allowed_actions": "selected" }
 
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.

get
{protocol}://{hostname}/api/v3/enterprises/{enterprise}/actions/permissions/organizations

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

enterprisestringrequired

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

Response

200 application/json

Response

total_countnumberrequired
organizationsarray[object]required

Organization Simple

Show Child Parameters
get/enterprises/{enterprise}/actions/permissions/organizations
 
200 application/json

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.”

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

put
{protocol}://{hostname}/api/v3/enterprises/{enterprise}/actions/permissions/organizations

Path Parameters

enterprisestringrequired

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

Body

application/json
selected_organization_idsarray[integer]required

Unique identifier of the organization.

Response

204

Response

put/enterprises/{enterprise}/actions/permissions/organizations

Body

{ "selected_organization_ids": [ 32, 91 ] }
 
204

Enable a selected organization for GitHub Actions in an enterprise

Adds an organization to 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.”

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

put
{protocol}://{hostname}/api/v3/enterprises/{enterprise}/actions/permissions/organizations/{org_id}

Path Parameters

enterprisestringrequired

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

org_idintegerrequired

Unique identifier of an organization.

Response

204

Response

put/enterprises/{enterprise}/actions/permissions/organizations/{org_id}
 
204