GitHub v3 REST API

Delete pull request review protection

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.

delete
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews

Path Parameters

ownerstringrequired
repostringrequired
branchstringrequired

The name of the branch.

Response

Response

delete/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews
 

Get commit signature protection

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.

When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of true indicates you must sign commits on this branch. For more information, see Signing commits with GPG in GitHub Help.

Note: You must enable branch protection to require signed commits.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures

Path Parameters

ownerstringrequired
repostringrequired
branchstringrequired

The name of the branch.

Response

application/json

Response

Protected Branch Admin Enforced

Protected Branch Admin Enforced

urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins

enabledbooleanrequired

Example:true

get/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures
 
application/json

Create commit signature protection

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.

When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.

post
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures

Path Parameters

ownerstringrequired
repostringrequired
branchstringrequired

The name of the branch.

Response

application/json

Response

Protected Branch Admin Enforced

Protected Branch Admin Enforced

urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins

enabledbooleanrequired

Example:true

post/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures
 
application/json

Delete commit signature protection

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.

When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.

delete
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures

Path Parameters

ownerstringrequired
repostringrequired
branchstringrequired

The name of the branch.

Response

Response

delete/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures
 

Get status checks protection

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks

Path Parameters

ownerstringrequired
repostringrequired
branchstringrequired

The name of the branch.

Response

application/json

Response

Status Check Policy

Status Check Policy

urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks

strictbooleanrequired

Example:true

contextsarray[string]required

Example:["continuous-integration/travis-ci"]

contexts_urlstring(uri)required

Example:https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts

get/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks
 
application/json