---
title: "Get all deployment protection rules for an environment"
method: GET
path: "/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
tags: ["repos"]
---

# Get all deployment protection rules for an environment

`GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules`

Gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)."

For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app).

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

## Path parameters

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

## Response `200`

List of deployment protection rules

- object
  - `total_count` integer — The number of enabled custom deployment protection rules for this environment
  - `custom_deployment_protection_rules` DeploymentProtectionRule[]
    - `id` integer, required — The unique identifier for the deployment protection rule.
    - `node_id` string, required — The node ID for the deployment protection rule.
    - `enabled` boolean, required — Whether the deployment protection rule is enabled for the environment.
    - `app` CustomDeploymentRuleApp, required — A GitHub App that is providing a custom deployment protection rule.
      - `id` integer, required — The unique identifier of the deployment protection rule integration.
      - `slug` string, required — The slugified name of the deployment protection rule integration.
      - `integration_url` string, required — The URL for the endpoint to get details about the app.
      - `node_id` string, required — The node ID for the deployment protection rule integration.

---

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