We've recently moved some of the REST API documentation. If you can't find what you're looking for, you might try the Actions REST API page.
审核日志
Get the audit log for an enterprise
Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the admin:enterprise
scope.
参数
标头 |
---|
名称, 类型, 描述 |
accept stringSetting to |
路径参数 |
名称, 类型, 描述 |
enterprise string必选The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
查询参数 |
名称, 类型, 描述 |
phrase stringA search phrase. For more information, see Searching the audit log. |
include stringThe event types to include:
The default is 可以是以下其中之一: |
after stringA cursor, as given in the Link header. If specified, the query only searches for events after this cursor. |
before stringA cursor, as given in the Link header. If specified, the query only searches for events before this cursor. |
order stringThe order of audit log events. To list newest events first, specify The default is 可以是以下其中之一: |
page integerPage number of the results to fetch. 默认值: |
per_page integerThe number of results per page (max 100). 默认值: |
HTTP 响应状态代码
状态代码 | 描述 |
---|---|
200 | OK |
代码示例
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/enterprises/ENTERPRISE/audit-log
Response
Status: 200
[
{
"@timestamp": 1606929874512,
"action": "team.add_member",
"actor": "octocat",
"created_at": 1606929874512,
"_document_id": "xJJFlFOhQ6b-5vaAFy9Rjw",
"org": "octo-corp",
"team": "octo-corp/example-team",
"user": "monalisa"
},
{
"@timestamp": 1606507117008,
"action": "org.create",
"actor": "octocat",
"created_at": 1606507117008,
"_document_id": "Vqvg6kZ4MYqwWRKFDzlMoQ",
"org": "octocat-test-org"
},
{
"@timestamp": 1605719148837,
"action": "repo.destroy",
"actor": "monalisa",
"created_at": 1605719148837,
"_document_id": "LwW2vpJZCDS-WUmo9Z-ifw",
"org": "mona-org",
"repo": "mona-org/mona-test-repo",
"visibility": "private"
}
]