---
title: "List branch protections for a repository"
method: GET
path: "/repos/{owner}/{repo}/branch_protections"
tags: ["repository"]
---

# List branch protections for a repository

`GET /repos/{owner}/{repo}/branch_protections`

## Path parameters

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

## Response `200`

BranchProtectionList

- BranchProtection[]
  - `approvals_whitelist_teams` string[]
  - `approvals_whitelist_username` string[]
  - `block_admin_merge_override` boolean
  - `block_on_codeowner_reviews` boolean
  - `block_on_official_review_requests` boolean
  - `block_on_outdated_branch` boolean
  - `block_on_rejected_reviews` boolean
  - `branch_name` string
  - `bypass_allowlist_teams` string[]
  - `bypass_allowlist_usernames` string[]
  - `created_at` string, date-time
  - `dismiss_stale_approvals` boolean
  - `enable_approvals_whitelist` boolean
  - `enable_bypass_allowlist` boolean
  - `enable_force_push` boolean
  - `enable_force_push_allowlist` boolean
  - `enable_merge_whitelist` boolean
  - `enable_push` boolean
  - `enable_push_whitelist` boolean
  - `enable_status_check` boolean
  - `force_push_allowlist_deploy_keys` boolean
  - `force_push_allowlist_teams` string[]
  - `force_push_allowlist_usernames` string[]
  - `ignore_stale_approvals` boolean
  - `merge_whitelist_teams` string[]
  - `merge_whitelist_usernames` string[]
  - `priority` integer — Priority is the priority of this branch protection rule
  - `protected_file_patterns` string
  - `push_whitelist_deploy_keys` boolean
  - `push_whitelist_teams` string[]
  - `push_whitelist_usernames` string[]
  - `require_signed_commits` boolean
  - `required_approvals` integer
  - `rule_name` string — RuleName is the name of the branch protection rule
  - `status_check_contexts` string[]
  - `unprotected_file_patterns` string
  - `updated_at` string, date-time

---

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