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 organizations and repositories that are allowed to run GitHub Actions, and the actions and reusable workflows that are allowed to run. For more information, see Disabling or limiting GitHub Actions for your organization, and Managing GitHub Actions settings for a repository.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

Get GitHub Actions permissions for an organization

GET /orgs/{org}/actions/permissions

Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.
OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/actions/permissions

Response schema (Status: 200):

Set GitHub Actions permissions for an organization

PUT /orgs/{org}/actions/permissions

Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/actions/permissions \
  -d '{
  "enabled_repositories": "all",
  "allowed_actions": "selected",
  "sha_pinning_required": true
}'

Response schema (Status: 204):

Get artifact and log retention settings for an organization

GET /orgs/{org}/actions/permissions/artifact-and-log-retention

Gets retention settings for checks, workflow runs, commit statuses, artifacts, and logs for an organization.
Checks include check suites, check runs, and check annotations. These settings also apply to checks and commit statuses created by third-party integrations, and are not limited to data created by GitHub Actions.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/actions/permissions/artifact-and-log-retention

Response schema (Status: 200):

Set artifact and log retention settings for an organization

PUT /orgs/{org}/actions/permissions/artifact-and-log-retention

Sets retention settings for checks, workflow runs, commit statuses, artifacts, and logs for an organization.
Checks include check suites, check runs, and check annotations. These settings also apply to checks and commit statuses created by third-party integrations, and are not limited to data created by GitHub Actions.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/actions/permissions/artifact-and-log-retention \
  -d '{
  "days": 100
}'

Response schema (Status: 204):

Get fork PR contributor approval permissions for an organization

GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval

Gets the fork PR contributor approval policy for an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/actions/permissions/fork-pr-contributor-approval

Response schema (Status: 200):

Set fork PR contributor approval permissions for an organization

PUT /orgs/{org}/actions/permissions/fork-pr-contributor-approval

Sets the fork PR contributor approval policy for an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Set approval policy to first time contributors

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/actions/permissions/fork-pr-contributor-approval \
  -d '{
  "approval_policy": "first_time_contributors"
}'

Response schema (Status: 204):

Get private repo fork PR workflow settings for an organization

GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos

Gets the settings for whether workflows from fork pull requests can run on private repositories in an organization.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/actions/permissions/fork-pr-workflows-private-repos

Response schema (Status: 200):

Set private repo fork PR workflow settings for an organization

PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos

Sets the settings for whether workflows from fork pull requests can run on private repositories in an organization.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/actions/permissions/fork-pr-workflows-private-repos \
  -d '{
  "run_workflows_from_fork_pull_requests": true,
  "send_write_tokens_to_workflows": false,
  "send_secrets_and_variables": false,
  "require_approval_for_fork_pr_workflows": true
}'

Response schema (Status: 204):

List selected repositories enabled for GitHub Actions in an organization

GET /orgs/{org}/actions/permissions/repositories

Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/actions/permissions/repositories

Response schema (Status: 200):

Set selected repositories enabled for GitHub Actions in an organization

PUT /orgs/{org}/actions/permissions/repositories

Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/actions/permissions/repositories \
  -d '{
  "selected_repository_ids": [
    32,
    42
  ]
}'

Response schema (Status: 204):

Enable a selected repository for GitHub Actions in an organization

PUT /orgs/{org}/actions/permissions/repositories/{repository_id}

Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."
OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/actions/permissions/repositories/REPOSITORY_ID

Response schema (Status: 204):

Disable a selected repository for GitHub Actions in an organization

DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}

Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."
OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/actions/permissions/repositories/REPOSITORY_ID

Response schema (Status: 204):

Get allowed actions and reusable workflows for an organization

GET /orgs/{org}/actions/permissions/selected-actions

Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."
OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/actions/permissions/selected-actions

Response schema (Status: 200):

Set allowed actions and reusable workflows for an organization

PUT /orgs/{org}/actions/permissions/selected-actions

Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/actions/permissions/selected-actions \
  -d '{
  "github_owned_allowed": true,
  "verified_allowed": false,
  "patterns_allowed": [
    "monalisa/octocat@*",
    "docker/*"
  ]
}'

Response schema (Status: 204):

Get self-hosted runners settings for an organization

GET /orgs/{org}/actions/permissions/self-hosted-runners

Gets the settings for self-hosted runners for an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners

Response schema (Status: 200):

Set self-hosted runners settings for an organization

PUT /orgs/{org}/actions/permissions/self-hosted-runners

Sets the settings for self-hosted runners for an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners \
  -d '{
  "enabled_repositories": "all"
}'

Response schema (Status: 204):

List repositories allowed to use self-hosted runners in an organization

GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories

Lists repositories that are allowed to use self-hosted runners in an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners/repositories

Response schema (Status: 200):

Set repositories allowed to use self-hosted runners in an organization

PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories

Sets repositories that are allowed to use self-hosted runners in an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners/repositories \
  -d '{
  "selected_repository_ids": [
    1,
    2,
    3
  ]
}'

Response schema (Status: 204):

Add a repository to the list of repositories allowed to use self-hosted runners in an organization

PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}

Adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners/repositories/REPOSITORY_ID

Response schema (Status: 204):

Remove a repository from the list of repositories allowed to use self-hosted runners in an organization

DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}

Removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization.
OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/actions/permissions/self-hosted-runners/repositories/REPOSITORY_ID

Response schema (Status: 204):

Get default workflow permissions for an organization

GET /orgs/{org}/actions/permissions/workflow

Gets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an organization,
as well as whether GitHub Actions can submit approving pull request reviews. For more information, see
"Setting the permissions of the GITHUB_TOKEN for your organization."
OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/actions/permissions/workflow

Response schema (Status: 200):

Set default workflow permissions for an organization

PUT /orgs/{org}/actions/permissions/workflow

Sets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an organization, and sets if GitHub Actions
can submit approving pull request reviews. For more information, see
"Setting the permissions of the GITHUB_TOKEN for your organization."
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Give read-only permission, and allow approving PRs.

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/actions/permissions/workflow \
  -d '{
  "default_workflow_permissions": "read",
  "can_approve_pull_request_reviews": true
}'

Response schema (Status: 204):

Get GitHub Actions permissions for a repository

GET /repos/{owner}/{repo}/actions/permissions

Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository.
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/actions/permissions

Response schema (Status: 200):

Set GitHub Actions permissions for a repository

PUT /repos/{owner}/{repo}/actions/permissions

Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/actions/permissions \
  -d '{
  "enabled": true,
  "allowed_actions": "selected",
  "sha_pinning_required": true
}'

Response schema (Status: 204):

Get the level of access for workflows outside of the repository

GET /repos/{owner}/{repo}/actions/permissions/access

Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.
This endpoint only applies to private repositories.
For more information, see "Allowing access to components in a private repository."
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/access

Response schema (Status: 200):

Set the level of access for workflows outside of the repository

PUT /repos/{owner}/{repo}/actions/permissions/access

Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.
This endpoint only applies to private repositories.
For more information, see "Allowing access to components in a private repository".
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/access \
  -d '{
  "access_level": "organization"
}'

Response schema (Status: 204):

Get artifact and log retention settings for a repository

GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention

Gets retention settings for checks, workflow runs, commit statuses, artifacts, and logs for a repository.
Checks include check suites, check runs, and check annotations. These settings also apply to checks and commit statuses created by third-party integrations, and are not limited to data created by GitHub Actions.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/artifact-and-log-retention

Response schema (Status: 200):

Same response schema as Get artifact and log retention settings for an organization.

Set artifact and log retention settings for a repository

PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention

Sets retention settings for checks, workflow runs, commit statuses, artifacts, and logs for a repository.
Checks include check suites, check runs, and check annotations. These settings also apply to checks and commit statuses created by third-party integrations, and are not limited to data created by GitHub Actions.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Set retention days

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/artifact-and-log-retention \
  -d '{
  "days": 90
}'

Response schema (Status: 204):

Get fork PR contributor approval permissions for a repository

GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval

Gets the fork PR contributor approval policy for a repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/fork-pr-contributor-approval

Response schema (Status: 200):

Same response schema as Get fork PR contributor approval permissions for an organization.

Set fork PR contributor approval permissions for a repository

PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval

Sets the fork PR contributor approval policy for a repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Set approval policy to first time contributors

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/fork-pr-contributor-approval \
  -d '{
  "approval_policy": "first_time_contributors"
}'

Response schema (Status: 204):

Get private repo fork PR workflow settings for a repository

GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos

Gets the settings for whether workflows from fork pull requests can run on a private repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/fork-pr-workflows-private-repos

Response schema (Status: 200):

Same response schema as Get private repo fork PR workflow settings for an organization.

Set private repo fork PR workflow settings for a repository

PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos

Sets the settings for whether workflows from fork pull requests can run on a private repository.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/fork-pr-workflows-private-repos \
  -d '{
  "run_workflows_from_fork_pull_requests": true,
  "send_write_tokens_to_workflows": false,
  "send_secrets_and_variables": false,
  "require_approval_for_fork_pr_workflows": true
}'

Response schema (Status: 204):

Get allowed actions and reusable workflows for a repository

GET /repos/{owner}/{repo}/actions/permissions/selected-actions

Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for a repository."
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/selected-actions

Response schema (Status: 200):

Same response schema as Get allowed actions and reusable workflows for an organization.

Set allowed actions and reusable workflows for a repository

PUT /repos/{owner}/{repo}/actions/permissions/selected-actions

Sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for a repository."
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/selected-actions \
  -d '{
  "github_owned_allowed": true,
  "verified_allowed": false,
  "patterns_allowed": [
    "monalisa/octocat@*",
    "docker/*"
  ]
}'

Response schema (Status: 204):

Get default workflow permissions for a repository

GET /repos/{owner}/{repo}/actions/permissions/workflow

Gets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in a repository,
as well as if GitHub Actions can submit approving pull request reviews.
For more information, see "Setting the permissions of the GITHUB_TOKEN for your repository."
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/workflow

Response schema (Status: 200):

Same response schema as Get default workflow permissions for an organization.

Set default workflow permissions for a repository

PUT /repos/{owner}/{repo}/actions/permissions/workflow

Sets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in a repository, and sets if GitHub Actions
can submit approving pull request reviews.
For more information, see "Setting the permissions of the GITHUB_TOKEN for your repository."
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Give read-only permission, and allow approving PRs.

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/actions/permissions/workflow \
  -d '{
  "default_workflow_permissions": "read",
  "can_approve_pull_request_reviews": true
}'

Response schema (Status: 204):