This version of GitHub Enterprise was discontinued on 2023-03-15. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.
After a site administrator upgrades your Enterprise Server instance to Enterprise Server 3.9 or later, the REST API will be versioned. To learn how to find your instance's version, see "About versions of GitHub Docs". For more information, see "About API versioning."
Admin stats
Use the REST API to retrieve a variety of metrics about your installation.
About admin stats
These endpoints are only available to authenticated site administrators. Normal users will receive a 404 response.
Get all statistics
HTTP response status codes for "Get all statistics"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get all statistics"
get/enterprise/stats/all
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/allResponse
Status: 200{
"repos": {
"total_repos": 212,
"root_repos": 194,
"fork_repos": 18,
"org_repos": 51,
"total_pushes": 3082,
"total_wikis": 15
},
"hooks": {
"total_hooks": 27,
"active_hooks": 23,
"inactive_hooks": 4
},
"pages": {
"total_pages": 36
},
"orgs": {
"total_orgs": 33,
"disabled_orgs": 0,
"total_teams": 60,
"total_team_members": 314
},
"users": {
"total_users": 254,
"admin_users": 45,
"suspended_users": 21
},
"pulls": {
"total_pulls": 86,
"merged_pulls": 60,
"mergeable_pulls": 21,
"unmergeable_pulls": 3
},
"issues": {
"total_issues": 179,
"open_issues": 83,
"closed_issues": 96
},
"milestones": {
"total_milestones": 7,
"open_milestones": 6,
"closed_milestones": 1
},
"gists": {
"total_gists": 178,
"private_gists": 151,
"public_gists": 25
},
"comments": {
"total_commit_comments": 6,
"total_gist_comments": 28,
"total_issue_comments": 366,
"total_pull_request_comments": 30
}
}Get comment statistics
HTTP response status codes for "Get comment statistics"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get comment statistics"
get/enterprise/stats/comments
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/commentsResponse
Status: 200Get gist statistics
HTTP response status codes for "Get gist statistics"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get gist statistics"
get/enterprise/stats/gists
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/gistsResponse
Status: 200Get hooks statistics
HTTP response status codes for "Get hooks statistics"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get hooks statistics"
get/enterprise/stats/hooks
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/hooksResponse
Status: 200Get issue statistics
HTTP response status codes for "Get issue statistics"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get issue statistics"
get/enterprise/stats/issues
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/issuesResponse
Status: 200Get milestone statistics
HTTP response status codes for "Get milestone statistics"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get milestone statistics"
get/enterprise/stats/milestones
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/milestonesResponse
Status: 200Get organization statistics
HTTP response status codes for "Get organization statistics"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get organization statistics"
get/enterprise/stats/orgs
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/orgsResponse
Status: 200Get pages statistics
HTTP response status codes for "Get pages statistics"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get pages statistics"
get/enterprise/stats/pages
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/pagesResponse
Status: 200Get pull request statistics
HTTP response status codes for "Get pull request statistics"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get pull request statistics"
get/enterprise/stats/pulls
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/pullsResponse
Status: 200Get repository statistics
HTTP response status codes for "Get repository statistics"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get repository statistics"
get/enterprise/stats/repos
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/reposResponse
Status: 200Get users statistics
HTTP response status codes for "Get users statistics"
| Status code | Description |
|---|---|
200 | OK |
Code samples for "Get users statistics"
get/enterprise/stats/users
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/usersResponse
Status: 200