How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

GitHub Branches API

The Branches API from GitHub — 14 operation(s) for branches.

GitHub Branches API is one of 350 APIs that GitHub publishes on the APIs.io network, described by a machine-readable OpenAPI specification and an AsyncAPI event-driven specification.

Tagged areas include Branches. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, an AsyncAPI specification, and an API reference.

This API exposes 20 operations across 13 paths, and defines 30 schemas. It is described by OpenAPI 3.2.0, at version 1.1.4.

Requests are made against 2 base URLs: {protocol}://{hostname}/api/v3, {protocol}://{hostname}.

20 operations 13 paths 30 schemas 3 DELETE9 GET5 POST3 PUT

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.2.0
API Version
1.1.4
Base URL
https://api.github.com
Authentication
HTTP Bearer
License
Terms of Service
Resource Areas
1

Authentication & Security 1

GitHub Branches API declares 1 security scheme for authenticating requests. It accepts HTTP bearer tokens (bearerHttpAuthentication).

  • bearerHttpAuthentication — Bearer Token

Paths & Operations 20

Across 13 paths, the API surfaces 20 operations — 3 DELETE, 9 GET, 5 POST, 3 PUT. Each is listed below with its method, path, parameters, and response codes.

Branches 20
GET
/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps
GitHub Get Apps with Access to the Protected Branch
getAppsWithAccessToTheProtectedBranch 3 params → 200404
GET
/repos/{owner}/{repo}/branches/{branch}
GitHub Get Branch
getBranch 6 params → 200301404
GET
/repos/{owner}/{repo}/branches/{branch}/protection
GitHub Get Branch Protection
getBranchProtection 6 params → 200404
PUT
/repos/{owner}/{repo}/branches/{branch}/protection
GitHub Update Branch Protection
updateBranchProtection 6 params body → 200403404422
DELETE
/repos/{owner}/{repo}/branches/{branch}/protection
GitHub Delete Branch Protection
deleteBranchProtection 6 params → 204403
GET
/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins
GitHub Get Admin Branch Protection
getAdminBranchProtection 6 params → 200
POST
/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins
GitHub Set Admin Branch Protection
setAdminBranchProtection 6 params → 200
DELETE
/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins
GitHub Delete Admin Branch Protection
deleteAdminBranchProtection 6 params → 204404
GET
/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams
GitHub Get Teams with Access to the Protected Branch
getTeamsWithAccessToTheProtectedBranch 6 params → 200404
GET
/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users
GitHub Get Users with Access to the Protected Branch
getUsersWithAccessToTheProtectedBranch 6 params → 200404
POST
/repos/{owner}/{repo}/branches/{branch}/rename
GitHub Rename Branch
renameBranch 6 params body → 201403404422
PUT
/repos/{owner}/{repo}/pulls/{pull_number}/update-branch
GitHub Update Pull Request Branch
updatePullRequestBranch 6 params body → 202403422
GET
/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head
GitHub List Branches for Head Commit
listBranchesForHeadCommit 6 params → 200422
GET
/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies
GitHub List Deployment Branch Policies
listDeploymentBranchPolicies 8 params → 200
POST
/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies
GitHub Create Deployment Branch Policy
createDeploymentBranchPolicy 6 params body → 200303404
GET
/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}
GitHub Get Deployment Branch Policy
getDeploymentBranchPolicy 7 params → 200
PUT
/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}
GitHub Update Deployment Branch Policy
updateDeploymentBranchPolicy 7 params body → 200
DELETE
/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}
GitHub Delete Deployment Branch Policy
deleteDeploymentBranchPolicy 7 params → 204
POST
/repos/{owner}/{repo}/merge-upstream
GitHub Sync Fork Branch with the Upstream Repository
syncForkBranchWithTheUpstreamRepository 5 params body → 200409422
POST
/repos/{owner}/{repo}/merges
GitHub Merge Branch
mergeBranch 5 params body → 201204403404409422

Schemas 30

The contract defines 30 schemas that model the data the API accepts and returns. The most detailed are nullable-simple-user_2 (21 properties), simple-user (21 properties), nullable-simple-user (21 properties), integration_2 (17 properties). Each schema is shown below with its type and property counts.

integration
object
GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They…
17 properties 11 required
nullable-simple-user
objectnull
A GitHub user.
21 properties 18 required
basic-error
object
Basic Error
4 properties
status-check-policy
object
Status Check Policy
5 properties 5 required
validation-error-simple
object
Validation Error Simple
3 properties 2 required
branch-with-protection
object
Branch With Protection
8 properties 6 required
protected-branch-required-status-check
object
Protected Branch Required Status Check
6 properties 2 required
team
object
Groups of organization members that gives permissions on specified repositories.
13 properties 11 required
branch-restriction-policy
object
Branch Restriction Policy
7 properties 7 required
diff-entry
object
Diff Entry
11 properties 9 required
commit
object
Commit
11 properties 9 required
nullable-git-user
object
Metaproperties for Git author/committer information.
3 properties
simple-user
object
GitHub user.
21 properties 18 required
protected-branch-pull-request-review
object
Protected Branch Pull Request Review
7 properties 2 required
validation-error
object
Validation Error
3 properties 2 required
verification
object
4 properties 4 required
branch-protection
object
Branch Protection
16 properties
protected-branch-admin-enforced
object
Protected Branch Admin Enforced
2 properties 2 required
integration_2
object
GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They…
17 properties 11 required
nullable-team-simple
object
Groups of organization members that gives permissions on specified repositories.
12 properties 10 required
empty-object
object
An object without any properties.
protected-branch
object
Branch protections protect branches
13 properties 1 required
nullable-simple-user_2
object
GitHub user.
21 properties 18 required
merged-upstream
object
Results of a successful merge upstream request
3 properties
deployment-branch-policy-name-pattern-with-type
object
1 property 1 required
deployment-branch-policy-name-pattern
object
1 property 1 required
branch-short
object
Branch Short
3 properties 3 required
deployment-branch-policy
object
Details of a deployment branch policy.
3 properties
team_2
object
Groups of organization members that gives permissions on specified repositories.
13 properties 11 required
nullable-team-simple_2
objectnull
Groups of organization members that gives permissions on specified repositories.
12 properties 10 required

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

github-branches-api-openapi.yml Raw ↑

Other APIs GitHub publishes across the network.

GitHub Events API
GitHub Feeds API
GitHub Gists API
GitHub Issues API
GitHub Licenses API
GitHub Markdown API
GitHub Meta API
GitHub Notifications API
GitHub Octocat API
GitHub Projects API
GitHub Repos API
GitHub Search API
Where this information came from

This is an independent, third-party profile of GitHub Branches API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.