v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
repos

Get all organization repository rulesets

Get all the repository rulesets for an organization.

get/orgs/{org}/rulesets

Path parameters

orgstring required

The organization name. The name is not case sensitive.

Query parameters

per_pageinteger

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

pageinteger

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

targetsstring
Example:branch,tag,push

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.

Response

Response

idinteger required

The ID of the ruleset

namestring required

The name of the ruleset

target'branch' | 'tag' | 'push' | 'repository'

The target of the ruleset

source_type'Repository' | 'Organization' | 'Enterprise'

The type of the source of the ruleset

sourcestring required

The name of the source

enforcement'disabled' | 'active' | 'evaluate' 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 not available for the repository target.

current_user_can_bypass'always' | 'pull_requests_only' | 'never' | 'exempt'

The bypass type of the user making the API request for this ruleset. This field is only returned when querying the repository-level endpoint.

node_idstring
created_atstring date-time
updated_atstring date-time