Skip to main content

Enterprise Server 3.21 está disponível no momento como versão candidata a lançamento.

A API REST agora é versionada. Para obter mais informações, confira "Sobre o controle de versão da API".

Pontos de extremidade da API REST para regras

Use a API REST para gerenciar conjuntos de regras para uma empresa. Os conjuntos de regras controlam como as pessoas podem interagir com repositórios e código.

Get enterprise ruleset history

Get the history of an enterprise ruleset.

Fine-grained access tokens for "Get enterprise ruleset history"

This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.

Parâmetros para "Get enterprise ruleset history"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
enterprise string Obrigatório

The slug version of the enterprise name.

ruleset_id integer Obrigatório

The ID of the ruleset.

Parâmetros de consulta
Nome, Tipo, Descrição
per_page integer

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

Padrão: 30

page integer

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

Padrão: 1

HTTP response status codes for "Get enterprise ruleset history"

Status codeDescrição
200

OK

404

Resource not found

500

Internal Error

Code samples for "Get enterprise ruleset history"

Request example

get/enterprises/{enterprise}/rulesets/{ruleset_id}/history
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/rulesets/RULESET_ID/history

Response

Status: 200
[ { "version_id": 3, "actor": { "id": 1, "type": "User" }, "updated_at": "2024-10-23T16:29:47Z" }, { "version_id": 2, "actor": { "id": 2, "type": "User" }, "updated_at": "2024-09-23T16:29:47Z" }, { "version_id": 1, "actor": { "id": 1, "type": "User" }, "updated_at": "2024-08-23T16:29:47Z" } ]

Get enterprise ruleset version

Get a version of an enterprise ruleset.

Fine-grained access tokens for "Get enterprise ruleset version"

This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.

Parâmetros para "Get enterprise ruleset version"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
enterprise string Obrigatório

The slug version of the enterprise name.

ruleset_id integer Obrigatório

The ID of the ruleset.

version_id integer Obrigatório

The ID of the version

HTTP response status codes for "Get enterprise ruleset version"

Status codeDescrição
200

OK

404

Resource not found

500

Internal Error

Code samples for "Get enterprise ruleset version"

Request example

get/enterprises/{enterprise}/rulesets/{ruleset_id}/history/{version_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/rulesets/RULESET_ID/history/VERSION_ID

Response

Status: 200
{ "version_id": 3, "actor": { "id": 1, "type": "User" }, "updated_at": "2024-10-23T16:29:47Z", "state": { "id": 21, "name": "super cool ruleset", "target": "repository", "source_type": "Enterprise", "source": "my-enterprise", "enforcement": "active", "conditions": { "organization_name": { "include": [ "important_organization" ] }, "repository_name": { "include": [ "~ALL" ] } }, "rules": [ { "type": "repository_delete" } ] } }