Branch protection
List status check context names reported for a repository ref.
Authorization
bearerAuth In: header
Path Parameters
Repository owner.
1 <= lengthRepository name.
1 <= lengthQuery Parameters
Branch, tag, or commit ref whose head statuses should be inspected.
1 <= lengthResponse Body
application/json
curl -X GET "https://example.com/v1/repositories/aa/aa/branch-protection-check-contexts?ref=aa""abc123"Authorization
bearerAuth In: header
Path Parameters
Repository owner.
1 <= lengthRepository name.
1 <= lengthResponse Body
application/json
curl -X GET "https://example.com/v1/repositories/aa/aa/branch-protections""abc123"Authorization
bearerAuth In: header
Path Parameters
Repository owner.
1 <= lengthRepository name.
1 <= lengthRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v1/repositories/aa/aa/branch-protections" \ -H "Content-Type: application/json" \ -d '{ "applyToAdmins": false, "approvalsWhitelistUsernames": [ "abc123" ], "blockOnOfficialReviewRequests": false, "blockOnOutdatedBranch": false, "blockOnRejectedReviews": false, "branchName": "aa", "dismissStaleApprovals": false, "enableApprovalsWhitelist": false, "enableMergeWhitelist": false, "enablePush": false, "enablePushWhitelist": false, "enableStatusCheck": false, "ignoreStaleApprovals": false, "mergeWhitelistUsernames": [ "abc123" ], "protectedFilePatterns": "abc123", "pushWhitelistDeployKeys": false, "pushWhitelistUsernames": [ "abc123" ], "requireSignedCommits": false, "requiredApprovals": 1, "ruleName": "abc123", "statusCheckContexts": [ "abc123" ], "unprotectedFilePatterns": "abc123" }'"abc123"Authorization
bearerAuth In: header
Path Parameters
Repository owner.
1 <= lengthRepository name.
1 <= lengthBranch name.
1 <= lengthResponse Body
application/json
curl -X GET "https://example.com/v1/repositories/aa/aa/branch-protections/aa""abc123"Authorization
bearerAuth In: header
Path Parameters
Repository owner.
1 <= lengthRepository name.
1 <= lengthBranch name (literal name only — patterns not yet supported).
1 <= lengthRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X PATCH "https://example.com/v1/repositories/aa/aa/branch-protections/aa" \ -H "Content-Type: application/json" \ -d '{ "applyToAdmins": false, "approvalsWhitelistUsernames": [ "abc123" ], "blockOnOfficialReviewRequests": false, "blockOnOutdatedBranch": false, "blockOnRejectedReviews": false, "dismissStaleApprovals": false, "enableApprovalsWhitelist": false, "enableMergeWhitelist": false, "enablePush": false, "enablePushWhitelist": false, "enableStatusCheck": false, "ignoreStaleApprovals": false, "mergeWhitelistUsernames": [ "abc123" ], "protectedFilePatterns": "abc123", "pushWhitelistDeployKeys": false, "pushWhitelistUsernames": [ "abc123" ], "requireSignedCommits": false, "requiredApprovals": 1, "ruleName": "abc123", "statusCheckContexts": [ "abc123" ], "unprotectedFilePatterns": "abc123" }'"abc123"Authorization
bearerAuth In: header
Path Parameters
Repository owner.
1 <= lengthRepository name.
1 <= lengthBranch name.
1 <= lengthResponse Body
application/json
curl -X DELETE "https://example.com/v1/repositories/aa/aa/branch-protections/aa""abc123"