List repository activities
Lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.
For more information about viewing repository activity, see “Viewing activity and data for your repository.”
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The account owner of the repository. The name is not case sensitive.
The name of the repository without the .git extension. The name is not case sensitive.
Query Parameters
Section titled “ Query Parameters ”The direction to sort the results by.
The number of results per page (max 100). For more information, see “Using pagination in the REST API.”
A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see “Using pagination in the REST API.”
A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see “Using pagination in the REST API.”
The Git reference for the activities you want to list.
The ref for a branch can be formatted either as refs/heads/BRANCH_NAME or BRANCH_NAME, where BRANCH_NAME is the name of your branch.
The GitHub username to use to filter by the actor who performed the activity.
The time period to filter by.
For example, day will filter for activity that occurred in the past 24 hours, and week will filter for activity that occurred in the past 7 days (168 hours).
The activity type to filter by.
For example, you can choose to filter by “force_push”, to see all force pushes to the repository.
Responses
Section titled “ Responses ”Response
Activity
object
The SHA of the commit before the activity.
The SHA of the commit after the activity.
The full Git reference, formatted as refs/heads/<branch name>.
The time when the activity occurred.
The type of the activity that was performed.
A GitHub user.
object
Examples
[ { "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "before": "6dcb09b5b57875f334f61aebed695e2e4193db5e", "after": "827efc6d56897b048c772eb4087f854f46256132", "ref": "refs/heads/main", "pushed_at": "2011-01-26T19:06:43Z", "push_type": "normal", "pusher": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false } }]Headers
Section titled “ Headers ”Example
<https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last"Validation failed, or the endpoint has been spammed.
Validation Error Simple
object
Example generated
{ "message": "example", "documentation_url": "example", "errors": [ "example" ]}