Use the REST API to manage rulesets for repositories. Rulesets control how people can interact with selected branches and tags in a repository.
Note
Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.
GET /repos/{owner}/{repo}/rules/branches/{branch}
Returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would apply
to a branch with that name will be returned. All active rules that apply will be returned, regardless of the level
at which they are configured (e.g. repository or organization). Rules in rulesets with "evaluate" or "disabled"
enforcement statuses are not returned.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
branch (string) (required)
The name of the branch. Cannot contain wildcard characters. To use wildcard characters in branch names, use the GraphQL API.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/rules/branches/BRANCH
Response schema (Status: 200):
Array of Repository Rule objects: one of:
GET /repos/{owner}/{repo}/rulesets
Get all the rulesets for a repository.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
includes_parents (boolean)
Include rulesets configured at higher levels that apply to this repository
Default: true
targets (string)
A comma-separated list of rule targets to filter by.
If provided, only rulesets that apply to the specified targets will be returned.
For example, branch,tag,push.
200 - OK
404 - Resource not found
500 - Internal Error
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/rulesets
Response schema (Status: 200):
Array of Repository ruleset:
id: required, integername: required, stringtarget: string, enum: branch, tag, push, repositorysource_type: string, enum: Repository, Organization, Enterprisesource: required, stringenforcement: required, string, enum: disabled, active, evaluatebypass_actors: array of Repository Ruleset Bypass Actor:
actor_id: integer or nullactor_type: required, string, enum: Integration, OrganizationAdmin, RepositoryRole, Team, DeployKey, Userbypass_mode: string, enum: always, pull_request, exempt, default: "always"current_user_can_bypass: string, enum: always, pull_requests_only, never, exemptnode_id: string_links: object:
self: object:
href: stringhtml: object or null:
href: stringconditions: any of:
ref_name: object:
include: array of stringexclude: array of stringrules: array of Repository Rule:
type: required, string, enum: creationtype: required, string, enum: updateparameters: object:
update_allows_fetch_and_merge: required, booleantype: required, string, enum: deletiontype: required, string, enum: required_linear_historytype: required, string, enum: merge_queueparameters: object:
check_response_timeout_minutes: required, integer, minimum: 1, maximum: 360grouping_strategy: required, string, enum: ALLGREEN, HEADGREENmax_entries_to_build: required, integer, minimum: 0, maximum: 100max_entries_to_merge: required, integer, minimum: 0, maximum: 100merge_method: required, string, enum: MERGE, SQUASH, REBASEmin_entries_to_merge: required, integer, minimum: 0, maximum: 100min_entries_to_merge_wait_minutes: required, integer, minimum: 0, maximum: 360type: required, string, enum: required_deploymentsparameters: object:
required_deployment_environments: required, array of stringtype: required, string, enum: required_signaturestype: required, string, enum: pull_requestparameters: object:
allowed_merge_methods: array of string, enum: merge, squash, rebasedismiss_stale_reviews_on_push: required, booleandismissal_restriction: DismissalRestriction:
allowed_actors: array of objectenabled: required, booleanrequire_code_owner_review: required, booleanrequire_last_push_approval: required, booleanrequired_approving_review_count: required, integer, minimum: 0, maximum: 10required_review_thread_resolution: required, booleanrequired_reviewers: array of RequiredReviewerConfiguration:
file_patterns: required, array of stringminimum_approvals: required, integerreviewer: required, objecttype: required, string, enum: required_status_checksparameters: object:
do_not_enforce_on_create: booleanrequired_status_checks: required, array of StatusCheckConfiguration:
context: required, stringintegration_id: integerstrict_required_status_checks_policy: required, booleantype: required, string, enum: non_fast_forwardtype: required, string, enum: commit_message_patternparameters: object:
name: stringnegate: booleanoperator: required, string, enum: starts_with, ends_with, contains, regexpattern: required, stringtype: required, string, enum: commit_author_email_patternparameters: object:
name: stringnegate: booleanoperator: required, string, enum: starts_with, ends_with, contains, regexpattern: required, stringtype: required, string, enum: committer_email_patternparameters: object:
name: stringnegate: booleanoperator: required, string, enum: starts_with, ends_with, contains, regexpattern: required, stringtype: required, string, enum: branch_name_patternparameters: object:
name: stringnegate: booleanoperator: required, string, enum: starts_with, ends_with, contains, regexpattern: required, stringtype: required, string, enum: tag_name_patternparameters: object:
name: stringnegate: booleanoperator: required, string, enum: starts_with, ends_with, contains, regexpattern: required, stringtype: required, string, enum: workflowsparameters: object:
do_not_enforce_on_create: booleanworkflows: required, array of WorkflowFileReference:
path: required, stringref: stringrepository_id: required, integersha: stringtype: required, string, enum: code_scanningparameters: object:
code_scanning_tools: required, array of CodeScanningTool:
alerts_threshold: required, string, enum: none, errors, errors_and_warnings, allsecurity_alerts_threshold: required, string, enum: none, critical, high_or_higher, medium_or_higher, alltool: required, stringtype: required, string, enum: code_qualityparameters: object:
severity: required, string, enum: errors, warnings, notes, alltype: required, string, enum: code_coverageparameters: object:
max_coverage_drop: number, format: float, minimum: 0, maximum: 100minimum_coverage: number, format: float, minimum: 0, maximum: 100type: required, string, enum: copilot_code_reviewparameters: object:
review_draft_pull_requests: booleanreview_on_push: booleantype: required, string, enum: license_compliance_scanningtype: required, string, enum: file_path_restrictionparameters: object:
restricted_file_paths: required, array of stringtype: required, string, enum: max_file_path_lengthparameters: object:
max_file_path_length: required, integer, minimum: 1, maximum: 32767type: required, string, enum: file_extension_restrictionparameters: object:
restricted_file_extensions: required, array of stringtype: required, string, enum: max_file_sizeparameters: object:
max_file_size: required, integer, minimum: 1, maximum: 100created_at: string, format: date-timeupdated_at: string, format: date-timePOST /repos/{owner}/{repo}/rulesets
Create a ruleset for a repository.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
name (string) (required)
The name of the ruleset.
target (string)
The target of the ruleset
Default: branch
Can be one of: branch, tag, push
enforcement (string) (required)
The enforcement level of the ruleset. evaluate allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (evaluate is only available with GitHub Enterprise).
Can be one of: disabled, active, evaluate
bypass_actors (array of objects)
The actors that can bypass the rules in this ruleset
actor_id (integer or null)actor_type (string) (required)Integration, OrganizationAdmin, RepositoryRole, Team, DeployKey, Userbypass_mode (string)alwaysalways, pull_request, exemptconditions (object)
Parameters for a repository ruleset ref name condition
ref_name (object)
include (array of strings)exclude (array of strings)rules (array of objects)
An array of rules within the ruleset.
creation (object)type (string) (required)creationupdate (object)type (string) (required)updateparameters (object)
update_allows_fetch_and_merge (boolean) (required)deletion (object)type (string) (required)deletionrequired_linear_history (object)type (string) (required)required_linear_historymerge_queue (object)type (string) (required)merge_queueparameters (object)
check_response_timeout_minutes (integer) (required)grouping_strategy (string) (required)ALLGREEN, HEADGREENmax_entries_to_build (integer) (required)max_entries_to_merge (integer) (required)merge_method (string) (required)MERGE, SQUASH, REBASEmin_entries_to_merge (integer) (required)min_entries_to_merge_wait_minutes (integer) (required)required_deployments (object)type (string) (required)required_deploymentsparameters (object)
required_deployment_environments (array of strings) (required)required_signatures (object)type (string) (required)required_signaturespull_request (object)type (string) (required)pull_requestparameters (object)
allowed_merge_methods (array of strings)dismiss_stale_reviews_on_push (boolean) (required)dismissal_restriction (object)allowed_actors (array of objects)id (integer) (required)type (string) (required)User, Team, IntegrationInstallation, RepositoryRoleenabled (boolean) (required)require_code_owner_review (boolean) (required)require_last_push_approval (boolean) (required)required_approving_review_count (integer) (required)required_review_thread_resolution (boolean) (required)required_reviewers (array of objects)file_patterns (array of strings) (required)minimum_approvals (integer) (required)reviewer (object) (required)id (integer) (required)type (string) (required)Teamrequired_status_checks (object)type (string) (required)required_status_checksparameters (object)
do_not_enforce_on_create (boolean)required_status_checks (array of objects) (required)context (string) (required)integration_id (integer)strict_required_status_checks_policy (boolean) (required)non_fast_forward (object)type (string) (required)non_fast_forwardcommit_message_pattern (object)type (string) (required)commit_message_patternparameters (object)
name (string)negate (boolean)operator (string) (required)starts_with, ends_with, contains, regexpattern (string) (required)commit_author_email_pattern (object)type (string) (required)commit_author_email_patternparameters (object)
name (string)negate (boolean)operator (string) (required)starts_with, ends_with, contains, regexpattern (string) (required)committer_email_pattern (object)type (string) (required)committer_email_patternparameters (object)
name (string)negate (boolean)operator (string) (required)starts_with, ends_with, contains, regexpattern (string) (required)branch_name_pattern (object)type (string) (required)branch_name_patternparameters (object)
name (string)negate (boolean)operator (string) (required)starts_with, ends_with, contains, regexpattern (string) (required)tag_name_pattern (object)type (string) (required)tag_name_patternparameters (object)
name (string)negate (boolean)operator (string) (required)starts_with, ends_with, contains, regexpattern (string) (required)workflows (object)type (string) (required)workflowsparameters (object)
do_not_enforce_on_create (boolean)workflows (array of objects) (required)path (string) (required)ref (string)repository_id (integer) (required)sha (string)code_scanning (object)type (string) (required)code_scanningparameters (object)
code_scanning_tools (array of objects) (required)alerts_threshold (string) (required)none, errors, errors_and_warnings, allsecurity_alerts_threshold (string) (required)none, critical, high_or_higher, medium_or_higher, alltool (string) (required)code_quality (object)type (string) (required)code_qualityparameters (object)
severity (string) (required)errors, warnings, notes, allcode_coverage (object)type (string) (required)code_coverageparameters (object)
max_coverage_drop (number)minimum_coverage (number)copilot_code_review (object)type (string) (required)copilot_code_reviewparameters (object)
review_draft_pull_requests (boolean)review_on_push (boolean)license_compliance_scanning (object)type (string) (required)license_compliance_scanningfile_path_restriction (object)type (string) (required)file_path_restrictionparameters (object)
restricted_file_paths (array of strings) (required)max_file_path_length (object)type (string) (required)max_file_path_lengthparameters (object)
max_file_path_length (integer) (required)file_extension_restriction (object)type (string) (required)file_extension_restrictionparameters (object)
restricted_file_extensions (array of strings) (required)max_file_size (object)type (string) (required)max_file_sizeparameters (object)
max_file_size (integer) (required)201 - Created
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
500 - Internal Error
Request:
curl -L \
-X POST \
https://api.github.com/repos/OWNER/REPO/rulesets \
-d '{
"name": "super cool ruleset",
"target": "branch",
"enforcement": "active",
"bypass_actors": [
{
"actor_id": 234,
"actor_type": "Team",
"bypass_mode": "always"
}
],
"conditions": {
"ref_name": {
"include": [
"refs/heads/main",
"refs/heads/master"
],
"exclude": [
"refs/heads/dev*"
]
}
},
"rules": [
{
"type": "commit_author_email_pattern",
"parameters": {
"operator": "contains",
"pattern": "github"
}
}
]
}'
Response schema (Status: 201):
id: required, integername: required, stringtarget: string, enum: branch, tag, push, repositorysource_type: string, enum: Repository, Organization, Enterprisesource: required, stringenforcement: required, string, enum: disabled, active, evaluatebypass_actors: array of Repository Ruleset Bypass Actor:
actor_id: integer or nullactor_type: required, string, enum: Integration, OrganizationAdmin, RepositoryRole, Team, DeployKey, Userbypass_mode: string, enum: always, pull_request, exempt, default: "always"current_user_can_bypass: string, enum: always, pull_requests_only, never, exemptnode_id: string_links: object:
self: object:
href: stringhtml: object or null:
href: stringconditions: any of:
ref_name: object:
include: array of stringexclude: array of stringrules: array of Repository Rule:
type: required, string, enum: creationtype: required, string, enum: updateparameters: object:
update_allows_fetch_and_merge: required, booleantype: required, string, enum: deletiontype: required, string, enum: required_linear_historytype: required, string, enum: merge_queueparameters: object:
check_response_timeout_minutes: required, integer, minimum: 1, maximum: 360grouping_strategy: required, string, enum: ALLGREEN, HEADGREENmax_entries_to_build: required, integer, minimum: 0, maximum: 100max_entries_to_merge: required, integer, minimum: 0, maximum: 100merge_method: required, string, enum: MERGE, SQUASH, REBASEmin_entries_to_merge: required, integer, minimum: 0, maximum: 100min_entries_to_merge_wait_minutes: required, integer, minimum: 0, maximum: 360type: required, string, enum: required_deploymentsparameters: object:
required_deployment_environments: required, array of stringtype: required, string, enum: required_signaturestype: required, string, enum: pull_requestparameters: object:
allowed_merge_methods: array of string, enum: merge, squash, rebasedismiss_stale_reviews_on_push: required, booleandismissal_restriction: DismissalRestriction:
allowed_actors: array of Actor:
id: required, integertype: required, string, enum: User, Team, IntegrationInstallation, RepositoryRoleenabled: required, booleanrequire_code_owner_review: required, booleanrequire_last_push_approval: required, booleanrequired_approving_review_count: required, integer, minimum: 0, maximum: 10required_review_thread_resolution: required, booleanrequired_reviewers: array of RequiredReviewerConfiguration:
file_patterns: required, array of stringminimum_approvals: required, integerreviewer: required, Reviewer:
id: required, integertype: required, string, enum: Teamtype: required, string, enum: required_status_checksparameters: object:
do_not_enforce_on_create: booleanrequired_status_checks: required, array of StatusCheckConfiguration:
context: required, stringintegration_id: integerstrict_required_status_checks_policy: required, booleantype: required, string, enum: non_fast_forwardtype: required, string, enum: commit_message_patternparameters: object:
name: stringnegate: booleanoperator: required, string, enum: starts_with, ends_with, contains, regexpattern: required, stringtype: required, string, enum: commit_author_email_patternparameters: object:
name: stringnegate: booleanoperator: required, string, enum: starts_with, ends_with, contains, regexpattern: required, stringtype: required, string, enum: committer_email_patternparameters: object:
name: stringnegate: booleanoperator: required, string, enum: starts_with, ends_with, contains, regexpattern: required, stringtype: required, string, enum: branch_name_patternparameters: object:
name: stringnegate: booleanoperator: required, string, enum: starts_with, ends_with, contains, regexpattern: required, stringtype: required, string, enum: tag_name_patternparameters: object:
name: stringnegate: booleanoperator: required, string, enum: starts_with, ends_with, contains, regexpattern: required, stringtype: required, string, enum: workflowsparameters: object:
do_not_enforce_on_create: booleanworkflows: required, array of WorkflowFileReference:
path: required, stringref: stringrepository_id: required, integersha: stringtype: required, string, enum: code_scanningparameters: object:
code_scanning_tools: required, array of CodeScanningTool:
alerts_threshold: required, string, enum: none, errors, errors_and_warnings, allsecurity_alerts_threshold: required, string, enum: none, critical, high_or_higher, medium_or_higher, alltool: required, stringtype: required, string, enum: code_qualityparameters: object:
severity: required, string, enum: errors, warnings, notes, alltype: required, string, enum: code_coverageparameters: object:
max_coverage_drop: number, format: float, minimum: 0, maximum: 100minimum_coverage: number, format: float, minimum: 0, maximum: 100type: required, string, enum: copilot_code_reviewparameters: object:
review_draft_pull_requests: booleanreview_on_push: booleantype: required, string, enum: license_compliance_scanningtype: required, string, enum: file_path_restrictionparameters: object:
restricted_file_paths: required, array of stringtype: required, string, enum: max_file_path_lengthparameters: object:
max_file_path_length: required, integer, minimum: 1, maximum: 32767type: required, string, enum: file_extension_restrictionparameters: object:
restricted_file_extensions: required, array of stringtype: required, string, enum: max_file_sizeparameters: object:
max_file_size: required, integer, minimum: 1, maximum: 100created_at: string, format: date-timeupdated_at: string, format: date-timeGET /repos/{owner}/{repo}/rulesets/{ruleset_id}
Get a ruleset for a repository.
Note: To prevent leaking sensitive information, the bypass_actors property is only returned if the user
making the API request has write access to the ruleset.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
ruleset_id (integer) (required)
The ID of the ruleset.
includes_parents (boolean)
Include rulesets configured at higher levels that apply to this repository
Default: true
200 - OK
404 - Resource not found
500 - Internal Error
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/rulesets/RULESET_ID
Response schema (Status: 200):
Same response schema as Create a repository ruleset.
PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}
Update a ruleset for a repository.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
ruleset_id (integer) (required)
The ID of the ruleset.
name (string)
The name of the ruleset.
target (string)
The target of the ruleset
Can be one of: branch, tag, push
enforcement (string)
The enforcement level of the ruleset. evaluate allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (evaluate is only available with GitHub Enterprise).
Can be one of: disabled, active, evaluate
bypass_actors (array of objects)
The actors that can bypass the rules in this ruleset
actor_id (integer or null)actor_type (string) (required)Integration, OrganizationAdmin, RepositoryRole, Team, DeployKey, Userbypass_mode (string)alwaysalways, pull_request, exemptconditions (object)
Parameters for a repository ruleset ref name condition
ref_name (object)
include (array of strings)exclude (array of strings)rules (array of objects)
An array of rules within the ruleset.
creation (object)type (string) (required)creationupdate (object)type (string) (required)updateparameters (object)
update_allows_fetch_and_merge (boolean) (required)deletion (object)type (string) (required)deletionrequired_linear_history (object)type (string) (required)required_linear_historymerge_queue (object)type (string) (required)merge_queueparameters (object)
check_response_timeout_minutes (integer) (required)grouping_strategy (string) (required)ALLGREEN, HEADGREENmax_entries_to_build (integer) (required)max_entries_to_merge (integer) (required)merge_method (string) (required)MERGE, SQUASH, REBASEmin_entries_to_merge (integer) (required)min_entries_to_merge_wait_minutes (integer) (required)required_deployments (object)type (string) (required)required_deploymentsparameters (object)
required_deployment_environments (array of strings) (required)required_signatures (object)type (string) (required)required_signaturespull_request (object)type (string) (required)pull_requestparameters (object)
allowed_merge_methods (array of strings)dismiss_stale_reviews_on_push (boolean) (required)dismissal_restriction (object)allowed_actors (array of objects)id (integer) (required)type (string) (required)User, Team, IntegrationInstallation, RepositoryRoleenabled (boolean) (required)require_code_owner_review (boolean) (required)require_last_push_approval (boolean) (required)required_approving_review_count (integer) (required)required_review_thread_resolution (boolean) (required)required_reviewers (array of objects)file_patterns (array of strings) (required)minimum_approvals (integer) (required)reviewer (object) (required)id (integer) (required)type (string) (required)Teamrequired_status_checks (object)type (string) (required)required_status_checksparameters (object)
do_not_enforce_on_create (boolean)required_status_checks (array of objects) (required)context (string) (required)integration_id (integer)strict_required_status_checks_policy (boolean) (required)non_fast_forward (object)type (string) (required)non_fast_forwardcommit_message_pattern (object)type (string) (required)commit_message_patternparameters (object)
name (string)negate (boolean)operator (string) (required)starts_with, ends_with, contains, regexpattern (string) (required)commit_author_email_pattern (object)type (string) (required)commit_author_email_patternparameters (object)
name (string)negate (boolean)operator (string) (required)starts_with, ends_with, contains, regexpattern (string) (required)committer_email_pattern (object)type (string) (required)committer_email_patternparameters (object)
name (string)negate (boolean)operator (string) (required)starts_with, ends_with, contains, regexpattern (string) (required)branch_name_pattern (object)type (string) (required)branch_name_patternparameters (object)
name (string)negate (boolean)operator (string) (required)starts_with, ends_with, contains, regexpattern (string) (required)tag_name_pattern (object)type (string) (required)tag_name_patternparameters (object)
name (string)negate (boolean)operator (string) (required)starts_with, ends_with, contains, regexpattern (string) (required)workflows (object)type (string) (required)workflowsparameters (object)
do_not_enforce_on_create (boolean)workflows (array of objects) (required)path (string) (required)ref (string)repository_id (integer) (required)sha (string)code_scanning (object)type (string) (required)code_scanningparameters (object)
code_scanning_tools (array of objects) (required)alerts_threshold (string) (required)none, errors, errors_and_warnings, allsecurity_alerts_threshold (string) (required)none, critical, high_or_higher, medium_or_higher, alltool (string) (required)code_quality (object)type (string) (required)code_qualityparameters (object)
severity (string) (required)errors, warnings, notes, allcode_coverage (object)type (string) (required)code_coverageparameters (object)
max_coverage_drop (number)minimum_coverage (number)copilot_code_review (object)type (string) (required)copilot_code_reviewparameters (object)
review_draft_pull_requests (boolean)review_on_push (boolean)license_compliance_scanning (object)type (string) (required)license_compliance_scanningfile_path_restriction (object)type (string) (required)file_path_restrictionparameters (object)
restricted_file_paths (array of strings) (required)max_file_path_length (object)type (string) (required)max_file_path_lengthparameters (object)
max_file_path_length (integer) (required)file_extension_restriction (object)type (string) (required)file_extension_restrictionparameters (object)
restricted_file_extensions (array of strings) (required)max_file_size (object)type (string) (required)max_file_sizeparameters (object)
max_file_size (integer) (required)200 - OK
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
500 - Internal Error
Request:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/rulesets/RULESET_ID \
-d '{
"name": "super cool ruleset",
"target": "branch",
"enforcement": "active",
"bypass_actors": [
{
"actor_id": 234,
"actor_type": "Team",
"bypass_mode": "always"
}
],
"conditions": {
"ref_name": {
"include": [
"refs/heads/main",
"refs/heads/master"
],
"exclude": [
"refs/heads/dev*"
]
}
},
"rules": [
{
"type": "commit_author_email_pattern",
"parameters": {
"operator": "contains",
"pattern": "github"
}
}
]
}'
Response schema (Status: 200):
Same response schema as Create a repository ruleset.
DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}
Delete a ruleset for a repository.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
ruleset_id (integer) (required)
The ID of the ruleset.
204 - No Content
404 - Resource not found
500 - Internal Error
Request:
curl -L \
-X DELETE \
https://api.github.com/repos/OWNER/REPO/rulesets/RULESET_ID
Response schema (Status: 204):
GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history
Get the history of a repository ruleset.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
ruleset_id (integer) (required)
The ID of the ruleset.
200 - OK
404 - Resource not found
500 - Internal Error
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/rulesets/RULESET_ID/history
Response schema (Status: 200):
Array of Ruleset version:
version_id: required, integeractor: required, object:
id: integertype: stringupdated_at: required, string, format: date-timeGET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}
Get a version of a repository ruleset.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
ruleset_id (integer) (required)
The ID of the ruleset.
version_id (integer) (required)
The ID of the version
200 - OK
404 - Resource not found
500 - Internal Error
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/rulesets/RULESET_ID/history/VERSION_ID
Response schema (Status: 200):
version_id: required, integeractor: required, object:
id: integertype: stringupdated_at: required, string, format: date-timestate: required, object