Sample - GitHub REST API
GET/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}

Get a repository ruleset version

Retrieves a specific historical version of a repository ruleset. Identify the repository, ruleset, and historical version with owner, repo, ruleset_id, and version_id. The response includes the version metadata and the ruleset state recorded for that version.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

4 parameters
ownerstringrequired
The account owner of the repository; the name is not case sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case sensitive.
ruleset_idintegerrequired
The numeric identifier of the ruleset.
version_idintegerrequired
The numeric identifier of the historical ruleset version.

3 status codes
200Returns the historical ruleset version, including its version ID, the actor who updated it, the update timestamp, and the ruleset state.
version_idintegerrequired
The ID of the previous version of the ruleset
actorobjectrequired
The actor who updated the ruleset
updated_atstringrequired
stateobjectrequired
The state of the ruleset version
404Returned when the repository, ruleset, or historical version does not exist.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
500Returned when an internal server error occurs.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 404 is returned when the repository, ruleset, or version cannot be found. A 500 is returned for an internal error. owner, repo, ruleset_id, and version_id must identify the historical ruleset version you want to retrieve.