---
title: "Add app access restrictions"
method: POST
path: "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
tags: ["repos"]
---

# Add app access restrictions

`POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps`

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.5/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

Grants the specified apps push access for this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.

## Path parameters

- `owner` string, required
- `repo` string, required
- `branch` string, required

## Request body

- union
  - object
    - `apps` string[], required — The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items.
  - string[]

## Response `200`

Response

- Integration[]
  - `id` integer, required — Unique identifier of the GitHub app
  - `slug` string — The slug name of the GitHub app
  - `node_id` string, required
  - `owner` NullableSimpleUser, nullable, 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
  - `name` string, required — The name of the GitHub app
  - `description` string, nullable, required
  - `external_url` string, uri, required
  - `html_url` string, uri, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `permissions` object, required — The set of permissions for the GitHub app
    - `issues` string
    - `checks` string
    - `metadata` string
    - `contents` string
    - `deployments` string
  - `events` string[], required — The list of events for the GitHub app
  - `installations_count` integer — The number of installations associated with the GitHub app
  - `client_id` string
  - `client_secret` string
  - `webhook_secret` string, nullable
  - `pem` string

## Other responses

- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-4.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-4/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-4/versions/ee6c7a46328e/schema)
