---
title: "List deployment branch policies"
method: GET
path: "/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
tags: ["repos"]
---

# List deployment branch policies

`GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies`

## Request

- Base URL: `http://HOSTNAME/api/v3`
- URL: `http://HOSTNAME/api/v3/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies`
- Auth: none declared

Lists the deployment branch policies for an environment.

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.

## Path parameters

- `owner` string, required
- `repo` string, required
- `environment_name` string, required

## Query parameters

- `per_page` integer
- `page` integer

## Response `200`

Response

- object
  - `total_count` integer, required: The number of deployment branch policies for the environment.
  - `branch_policies` DeploymentBranchPolicy[], required
    - `id` integer: The unique identifier of the branch policy.
    - `node_id` string
    - `name` string: The name pattern that branches must match in order to deploy to the environment.

---

[API](https://skmtc.dev/github/apis/enterprise-server.md) · [All operations](https://skmtc.dev/github/apis/enterprise-server/llms.txt) · [OpenAPI document](https://skmtc.dev/github/apis/enterprise-server/revisions/5438365412fe?raw)
