Get a specific branch protection for the repository
GET
/repos/{owner}/{repo}/branch_protections/{name}
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” owner
required
string
Owner of the repo
repo
required
string
Name of the repo
name
required
string
Name of protected branch
Responses
Section titled “ Responses ”BranchProtection
Media type application/json
BranchProtection represents a branch protection for a repository
object
apply_to_admins
boolean
approvals_whitelist_teams
Array<string>
approvals_whitelist_username
Array<string>
block_on_official_review_requests
boolean
block_on_outdated_branch
boolean
block_on_rejected_reviews
boolean
branch_name
Deprecated: true
string
created_at
string format: date-time
dismiss_stale_approvals
boolean
enable_approvals_whitelist
boolean
enable_merge_whitelist
boolean
enable_push
boolean
enable_push_whitelist
boolean
enable_status_check
boolean
ignore_stale_approvals
boolean
merge_whitelist_teams
Array<string>
merge_whitelist_usernames
Array<string>
protected_file_patterns
string
push_whitelist_deploy_keys
boolean
push_whitelist_teams
Array<string>
push_whitelist_usernames
Array<string>
require_signed_commits
boolean
required_approvals
integer format: int64
rule_name
string
status_check_contexts
Array<string>
unprotected_file_patterns
string
updated_at
string format: date-time
Example generated
{ "apply_to_admins": true, "approvals_whitelist_teams": [ "example" ], "approvals_whitelist_username": [ "example" ], "block_on_official_review_requests": true, "block_on_outdated_branch": true, "block_on_rejected_reviews": true, "branch_name": "example", "created_at": "2026-04-15T12:00:00Z", "dismiss_stale_approvals": true, "enable_approvals_whitelist": true, "enable_merge_whitelist": true, "enable_push": true, "enable_push_whitelist": true, "enable_status_check": true, "ignore_stale_approvals": true, "merge_whitelist_teams": [ "example" ], "merge_whitelist_usernames": [ "example" ], "protected_file_patterns": "example", "push_whitelist_deploy_keys": true, "push_whitelist_teams": [ "example" ], "push_whitelist_usernames": [ "example" ], "require_signed_commits": true, "required_approvals": 1, "rule_name": "example", "status_check_contexts": [ "example" ], "unprotected_file_patterns": "example", "updated_at": "2026-04-15T12:00:00Z"}APINotFound is a not found error response
Media type application/json
object
errors
Array<string>
message
string
url
string
Example generated
{ "errors": [ "example" ], "message": "example", "url": "example"}