---
title: "Create an installation access token for an app"
method: POST
path: "/app/installations/{installation_id}/access_tokens"
tags: ["apps"]
---

# Create an installation access token for an app

`POST /app/installations/{installation_id}/access_tokens`

Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. 

Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don't use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.

Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.

When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported. 

You must use a [JWT](https://docs.github.com/enterprise-server@3.8/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.

## Path parameters

- `installation_id` integer, required

## Request body

- object
  - `repositories` string[] — List of repository names that the token should have access to
  - `repository_ids` integer[] — List of repository IDs that the token should have access to
  - `permissions` AppPermissions — The permissions granted to the user access token.
    - `actions` 'read' | 'write' — The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts.
    - `administration` 'read' | 'write' — The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation.
    - `checks` 'read' | 'write' — The level of permission to grant the access token for checks on code.
    - `codespaces` 'read' | 'write' — The level of permission to grant the access token to create, edit, delete, and list Codespaces.
    - `contents` 'read' | 'write' — The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges.
    - `dependabot_secrets` 'read' | 'write' — The leve of permission to grant the access token to manage Dependabot secrets.
    - `deployments` 'read' | 'write' — The level of permission to grant the access token for deployments and deployment statuses.
    - `environments` 'read' | 'write' — The level of permission to grant the access token for managing repository environments.
    - `issues` 'read' | 'write' — The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones.
    - `metadata` 'read' | 'write' — The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata.
    - `packages` 'read' | 'write' — The level of permission to grant the access token for packages published to GitHub Packages.
    - `pages` 'read' | 'write' — The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds.
    - `pull_requests` 'read' | 'write' — The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges.
    - `repository_hooks` 'read' | 'write' — The level of permission to grant the access token to manage the post-receive hooks for a repository.
    - `repository_projects` 'read' | 'write' | 'admin' — The level of permission to grant the access token to manage repository projects, columns, and cards.
    - `secret_scanning_alerts` 'read' | 'write' — The level of permission to grant the access token to view and manage secret scanning alerts.
    - `secrets` 'read' | 'write' — The level of permission to grant the access token to manage repository secrets.
    - `security_events` 'read' | 'write' — The level of permission to grant the access token to view and manage security events like code scanning alerts.
    - `single_file` 'read' | 'write' — The level of permission to grant the access token to manage just a single file.
    - `statuses` 'read' | 'write' — The level of permission to grant the access token for commit statuses.
    - `vulnerability_alerts` 'read' | 'write' — The level of permission to grant the access token to manage Dependabot alerts.
    - `workflows` 'write' — The level of permission to grant the access token to update GitHub Actions workflow files.
    - `members` 'read' | 'write' — The level of permission to grant the access token for organization teams and members.
    - `organization_administration` 'read' | 'write' — The level of permission to grant the access token to manage access to an organization.
    - `organization_copilot_seat_management` 'write' — The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change.
    - `organization_announcement_banners` 'read' | 'write' — The level of permission to grant the access token to view and manage announcement banners for an organization.
    - `organization_events` 'read' — The level of permission to grant the access token to view events triggered by an activity in an organization.
    - `organization_hooks` 'read' | 'write' — The level of permission to grant the access token to manage the post-receive hooks for an organization.
    - `organization_personal_access_tokens` 'read' | 'write' — The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization.
    - `organization_personal_access_token_requests` 'read' | 'write' — The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization.
    - `organization_plan` 'read' — The level of permission to grant the access token for viewing an organization's plan.
    - `organization_projects` 'read' | 'write' | 'admin' — The level of permission to grant the access token to manage organization projects and projects beta (where available).
    - `organization_packages` 'read' | 'write' — The level of permission to grant the access token for organization packages published to GitHub Packages.
    - `organization_secrets` 'read' | 'write' — The level of permission to grant the access token to manage organization secrets.
    - `organization_self_hosted_runners` 'read' | 'write' — The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization.
    - `organization_user_blocking` 'read' | 'write' — The level of permission to grant the access token to view and manage users blocked by the organization.
    - `team_discussions` 'read' | 'write' — The level of permission to grant the access token to manage team discussions and related comments.
    - `email_addresses` 'read' | 'write' — The level of permission to grant the access token to manage the email addresses belonging to a user.
    - `followers` 'read' | 'write' — The level of permission to grant the access token to manage the followers belonging to a user.
    - `git_ssh_keys` 'read' | 'write' — The level of permission to grant the access token to manage git SSH keys.
    - `gpg_keys` 'read' | 'write' — The level of permission to grant the access token to view and manage GPG keys belonging to a user.
    - `interaction_limits` 'read' | 'write' — The level of permission to grant the access token to view and manage interaction limits on a repository.
    - `profile` 'write' — The level of permission to grant the access token to manage the profile settings belonging to a user.
    - `starring` 'read' | 'write' — The level of permission to grant the access token to list and manage repositories a user is starring.

## Response `201`

Response

- InstallationToken — Authentication token for a GitHub App installed on a user or org.
  - `token` string, required
  - `expires_at` string, required
  - `permissions` AppPermissions — The permissions granted to the user access token.
    - `actions` 'read' | 'write' — The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts.
    - `administration` 'read' | 'write' — The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation.
    - `checks` 'read' | 'write' — The level of permission to grant the access token for checks on code.
    - `codespaces` 'read' | 'write' — The level of permission to grant the access token to create, edit, delete, and list Codespaces.
    - `contents` 'read' | 'write' — The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges.
    - `dependabot_secrets` 'read' | 'write' — The leve of permission to grant the access token to manage Dependabot secrets.
    - `deployments` 'read' | 'write' — The level of permission to grant the access token for deployments and deployment statuses.
    - `environments` 'read' | 'write' — The level of permission to grant the access token for managing repository environments.
    - `issues` 'read' | 'write' — The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones.
    - `metadata` 'read' | 'write' — The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata.
    - `packages` 'read' | 'write' — The level of permission to grant the access token for packages published to GitHub Packages.
    - `pages` 'read' | 'write' — The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds.
    - `pull_requests` 'read' | 'write' — The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges.
    - `repository_hooks` 'read' | 'write' — The level of permission to grant the access token to manage the post-receive hooks for a repository.
    - `repository_projects` 'read' | 'write' | 'admin' — The level of permission to grant the access token to manage repository projects, columns, and cards.
    - `secret_scanning_alerts` 'read' | 'write' — The level of permission to grant the access token to view and manage secret scanning alerts.
    - `secrets` 'read' | 'write' — The level of permission to grant the access token to manage repository secrets.
    - `security_events` 'read' | 'write' — The level of permission to grant the access token to view and manage security events like code scanning alerts.
    - `single_file` 'read' | 'write' — The level of permission to grant the access token to manage just a single file.
    - `statuses` 'read' | 'write' — The level of permission to grant the access token for commit statuses.
    - `vulnerability_alerts` 'read' | 'write' — The level of permission to grant the access token to manage Dependabot alerts.
    - `workflows` 'write' — The level of permission to grant the access token to update GitHub Actions workflow files.
    - `members` 'read' | 'write' — The level of permission to grant the access token for organization teams and members.
    - `organization_administration` 'read' | 'write' — The level of permission to grant the access token to manage access to an organization.
    - `organization_copilot_seat_management` 'write' — The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change.
    - `organization_announcement_banners` 'read' | 'write' — The level of permission to grant the access token to view and manage announcement banners for an organization.
    - `organization_events` 'read' — The level of permission to grant the access token to view events triggered by an activity in an organization.
    - `organization_hooks` 'read' | 'write' — The level of permission to grant the access token to manage the post-receive hooks for an organization.
    - `organization_personal_access_tokens` 'read' | 'write' — The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization.
    - `organization_personal_access_token_requests` 'read' | 'write' — The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization.
    - `organization_plan` 'read' — The level of permission to grant the access token for viewing an organization's plan.
    - `organization_projects` 'read' | 'write' | 'admin' — The level of permission to grant the access token to manage organization projects and projects beta (where available).
    - `organization_packages` 'read' | 'write' — The level of permission to grant the access token for organization packages published to GitHub Packages.
    - `organization_secrets` 'read' | 'write' — The level of permission to grant the access token to manage organization secrets.
    - `organization_self_hosted_runners` 'read' | 'write' — The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization.
    - `organization_user_blocking` 'read' | 'write' — The level of permission to grant the access token to view and manage users blocked by the organization.
    - `team_discussions` 'read' | 'write' — The level of permission to grant the access token to manage team discussions and related comments.
    - `email_addresses` 'read' | 'write' — The level of permission to grant the access token to manage the email addresses belonging to a user.
    - `followers` 'read' | 'write' — The level of permission to grant the access token to manage the followers belonging to a user.
    - `git_ssh_keys` 'read' | 'write' — The level of permission to grant the access token to manage git SSH keys.
    - `gpg_keys` 'read' | 'write' — The level of permission to grant the access token to view and manage GPG keys belonging to a user.
    - `interaction_limits` 'read' | 'write' — The level of permission to grant the access token to view and manage interaction limits on a repository.
    - `profile` 'write' — The level of permission to grant the access token to manage the profile settings belonging to a user.
    - `starring` 'read' | 'write' — The level of permission to grant the access token to list and manage repositories a user is starring.
  - `repository_selection` 'all' | 'selected'
  - `repositories` Repository[]
    - `id` integer, required — Unique identifier of the repository
    - `node_id` string, required
    - `name` string, required — The name of the repository.
    - `full_name` string, required
    - `license` NullableLicenseSimple, nullable, required — License Simple
      - `key` string, required
      - `name` string, required
      - `url` string, uri, nullable, required
      - `spdx_id` string, nullable, required
      - `node_id` string, required
      - `html_url` string, uri
    - `forks` integer, required
    - `permissions` object
      - `admin` boolean, required
      - `pull` boolean, required
      - `triage` boolean
      - `push` boolean, required
      - `maintain` boolean
    - `owner` SimpleUser, required — A GitHub user.
      - `name` string, nullable
      - `email` string, nullable
      - `login` string, required
      - `id` integer, required
      - `node_id` string, required
      - `avatar_url` string, uri, required
      - `gravatar_id` string, nullable, required
      - `url` string, uri, required
      - `html_url` string, uri, required
      - `followers_url` string, uri, required
      - `following_url` string, required
      - `gists_url` string, required
      - `starred_url` string, required
      - `subscriptions_url` string, uri, required
      - `organizations_url` string, uri, required
      - `repos_url` string, uri, required
      - `events_url` string, required
      - `received_events_url` string, uri, required
      - `type` string, required
      - `site_admin` boolean, required
      - `starred_at` string
    - `private` boolean, required — Whether the repository is private or public.
    - `html_url` string, uri, required
    - `description` string, nullable, required
    - `fork` boolean, required
    - `url` string, uri, required
    - `archive_url` string, required
    - `assignees_url` string, required
    - `blobs_url` string, required
    - `branches_url` string, required
    - `collaborators_url` string, required
    - `comments_url` string, required
    - `commits_url` string, required
    - `compare_url` string, required
    - `contents_url` string, required
    - `contributors_url` string, uri, required
    - `deployments_url` string, uri, required
    - `downloads_url` string, uri, required
    - `events_url` string, uri, required
    - `forks_url` string, uri, required
    - `git_commits_url` string, required
    - `git_refs_url` string, required
    - `git_tags_url` string, required
    - `git_url` string, required
    - `issue_comment_url` string, required
    - `issue_events_url` string, required
    - `issues_url` string, required
    - `keys_url` string, required
    - `labels_url` string, required
    - `languages_url` string, uri, required
    - `merges_url` string, uri, required
    - `milestones_url` string, required
    - `notifications_url` string, required
    - `pulls_url` string, required
    - `releases_url` string, required
    - `ssh_url` string, required
    - `stargazers_url` string, uri, required
    - `statuses_url` string, required
    - `subscribers_url` string, uri, required
    - `subscription_url` string, uri, required
    - `tags_url` string, uri, required
    - `teams_url` string, uri, required
    - `trees_url` string, required
    - `clone_url` string, required
    - `mirror_url` string, uri, nullable, required
    - `hooks_url` string, uri, required
    - `svn_url` string, uri, required
    - `homepage` string, uri, nullable, required
    - `language` string, nullable, required
    - `forks_count` integer, required
    - `stargazers_count` integer, required
    - `watchers_count` integer, required
    - `size` integer, required — The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0.
    - `default_branch` string, required — The default branch of the repository.
    - `open_issues_count` integer, required
    - `is_template` boolean — Whether this repository acts as a template that can be used to generate new repositories.
    - `topics` string[]
    - `has_issues` boolean, required — Whether issues are enabled.
    - `has_projects` boolean, required — Whether projects are enabled.
    - `has_wiki` boolean, required — Whether the wiki is enabled.
    - `has_pages` boolean, required
    - `has_downloads` boolean, required — Whether downloads are enabled.
    - `has_discussions` boolean — Whether discussions are enabled.
    - `archived` boolean, required — Whether the repository is archived.
    - `disabled` boolean, required — Returns whether or not this repository disabled.
    - `visibility` string — The repository visibility: public, private, or internal.
    - `pushed_at` string, date-time, nullable, required
    - `created_at` string, date-time, nullable, required
    - `updated_at` string, date-time, nullable, required
    - `allow_rebase_merge` boolean — Whether to allow rebase merges for pull requests.
    - `temp_clone_token` string
    - `allow_squash_merge` boolean — Whether to allow squash merges for pull requests.
    - `allow_auto_merge` boolean — Whether to allow Auto-merge to be used on pull requests.
    - `delete_branch_on_merge` boolean — Whether to delete head branches when pull requests are merged
    - `allow_update_branch` boolean — Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging.
    - `use_squash_pr_title_as_default` boolean — Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead.
    - `squash_merge_commit_title` 'PR_TITLE' | 'COMMIT_OR_PR_TITLE' — The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).
    - `squash_merge_commit_message` 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK' — The default value for a squash merge commit message: - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message.
    - `merge_commit_title` 'PR_TITLE' | 'MERGE_MESSAGE' — The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).
    - `merge_commit_message` 'PR_BODY' | 'PR_TITLE' | 'BLANK' — The default value for a merge commit message. - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message.
    - `allow_merge_commit` boolean — Whether to allow merge commits for pull requests.
    - `allow_forking` boolean — Whether to allow forking this repo
    - `web_commit_signoff_required` boolean — Whether to require contributors to sign off on web-based commits
    - `open_issues` integer, required
    - `watchers` integer, required
    - `master_branch` string
    - `starred_at` string
    - `anonymous_access_enabled` boolean — Whether anonymous git access is enabled for this repository
  - `single_file` string
  - `has_multiple_single_files` boolean
  - `single_file_paths` string[]

## Other responses

- `401` — Requires authentication
- `403` — Forbidden
- `404` — Resource not found
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/enterprise-server.md) · [All operations](https://skmtc.net/github/apis/enterprise-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/enterprise-server/revisions/5438365412fe/schema)
