Retrieve a specific branch from a repository, including its effective branch protection
GET
/repos/{owner}/{repo}/branches/{branch}
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
branch
required
string
Branch to get
Responses
Section titled “ Responses ”Branch
Media type application/json
Branch represents a repository branch
object
commit
PayloadCommit represents a commit
object
added
Array<string>
author
PayloadUser represents the author or committer of a commit
object
email
string format: email
name
Full name of the commit author
string
username
string
committer
PayloadUser represents the author or committer of a commit
object
email
string format: email
name
Full name of the commit author
string
username
string
id
Sha1 hash of the commit
string
message
string
modified
Array<string>
removed
Array<string>
timestamp
string format: date-time
url
string
verification
PayloadCommitVerification represents the GPG verification of a commit
object
payload
string
reason
string
signature
string
signer
PayloadUser represents the author or committer of a commit
object
email
string format: email
name
Full name of the commit author
string
username
string
verified
boolean
effective_branch_protection_name
string
enable_status_check
boolean
name
string
protected
boolean
required_approvals
integer format: int64
status_check_contexts
Array<string>
user_can_merge
boolean
user_can_push
boolean
Example generated
{ "commit": { "added": [ "example" ], "author": { "email": "hello@example.com", "name": "example", "username": "example" }, "committer": { "email": "hello@example.com", "name": "example", "username": "example" }, "id": "example", "message": "example", "modified": [ "example" ], "removed": [ "example" ], "timestamp": "2026-04-15T12:00:00Z", "url": "example", "verification": { "payload": "example", "reason": "example", "signature": "example", "signer": { "email": "hello@example.com", "name": "example", "username": "example" }, "verified": true } }, "effective_branch_protection_name": "example", "enable_status_check": true, "name": "example", "protected": true, "required_approvals": 1, "status_check_contexts": [ "example" ], "user_can_merge": true, "user_can_push": true}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"}