v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
apps

Toggle installation repository access between selected and all repositories

Toggle repository access for a GitHub App installation between all repositories and selected repositories. You must provide at least one repository when changing the access to 'selected'. If you change the access to 'all', the repositories list must not be provided.

This API can only be called by a GitHub App installed on the enterprise that owns the organization.

patch/enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories

Path parameters

enterprisestring required

The slug version of the enterprise name.

orgstring required

The organization name. The name is not case sensitive.

installation_idinteger required

The unique identifier of the installation.

Request body

repository_selection'all' | 'selected' required

One of either 'all' or 'selected'

repositoriesstring[]

The repository names to add to the installation. Only required when repository_selection is 'selected'

Response

The GitHub App installation that was updated.

idinteger required

The ID of the installation.

repository_selection'all' | 'selected' required

Describe whether all repositories have been selected or there's a selection involved. For enterprise installations this is selected.

access_tokens_urlstring uri required
repositories_urlstring uri required
html_urlstring uri required
app_idinteger required
client_idstring
target_idinteger required

The ID of the user or organization this token is being scoped to.

target_typestring required
eventsstring[] required
created_atstring date-time required
updated_atstring date-time required
single_file_namestring nullable required
has_multiple_single_filesboolean
single_file_pathsstring[]
app_slugstring required
suspended_atstring date-time nullable required
contact_emailstring nullable

Example response

{
  "id": 1,
  "account": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "41d064eb2195891e12d0413f63227ea7",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "starred_at": "\"2020-07-09T00:17:55Z\"",
    "user_view_type": "public"
  },
  "access_tokens_url": "https://api.github.com/app/installations/1/access_tokens",
  "repositories_url": "https://api.github.com/installation/repositories",
  "html_url": "https://github.com/organizations/github/settings/installations/1",
  "app_id": 1,
  "client_id": "Iv1.ab1112223334445c",
  "target_type": "Organization",
  "permissions": {
    "contents": "read",
    "issues": "read",
    "deployments": "write",
    "single_file": "read"
  },
  "single_file_name": "config.yaml",
  "has_multiple_single_files": true,
  "single_file_paths": [
    "config.yml",
    ".github/issue_TEMPLATE.md"
  ],
  "app_slug": "github-actions",
  "suspended_by": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "41d064eb2195891e12d0413f63227ea7",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "starred_at": "\"2020-07-09T00:17:55Z\"",
    "user_view_type": "public"
  },
  "contact_email": "\"test_13f1e99741e3e004@d7e1eb0bc0a1ba12.com\""
}