GitHub v3 REST API

Protected Branch Required Status Check

object

Protected Branch Required Status Check

urlstring
enforcement_levelstring
contextsarray[string]required
contexts_urlstring
strictboolean
Example

Protected Branch Admin Enforced

object

Protected Branch Admin Enforced

urlstring(uri)required

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

enabledbooleanrequired

Example:true

Example

Protected Branch Pull Request Review

object

Protected Branch Pull Request Review

urlstring(uri)

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

dismissal_restrictionsobject
Show Child Parameters
dismiss_stale_reviewsbooleanrequired

Example:true

require_code_owner_reviewsbooleanrequired

Example:true

required_approving_review_countinteger

>= 1<= 6

Example:2

Example

Branch Restriction Policy

object

Branch Restriction Policy

urlstring(uri)required
users_urlstring(uri)required
teams_urlstring(uri)required
apps_urlstring(uri)required
usersarray[object]required
Show Child Parameters
teamsarray[object]required
Show Child Parameters
appsarray[object]required
Show Child Parameters
Example

Branch Protection

object

Branch Protection

urlstring
enabledboolean
required_status_checksobject

Protected Branch Required Status Check

Show Child Parameters
enforce_adminsobject

Protected Branch Admin Enforced

Show Child Parameters
required_pull_request_reviewsobject

Protected Branch Pull Request Review

Show Child Parameters
restrictionsobject

Branch Restriction Policy

Show Child Parameters
required_linear_historyobject
Show Child Parameters
allow_force_pushesobject
Show Child Parameters
allow_deletionsobject
Show Child Parameters
required_conversation_resolutionobject
Show Child Parameters
namestring

Example:"branch/with/protection"

protection_urlstring

Example:"https://api.github.com/repos/owner-79e94e2d36b3fd06a32bb213/AAA_Public_Repo/branches/branch/with/protection/protection"

required_signaturesobject
Show Child Parameters
Example