Integrations
GitHub
APIs
Search Enterprise Audit Logs

Search Audit Logs for an Enterprise

This method enables users to query the audit logs for a specified enterprise. Events include what action was performed, who performed the action, and when the action was performed.

For more information on the GitHub Audit logs API, see Here (opens in a new tab).

To use this API endpoint, your GitHub token requires the following scopes:

- audit_log

SDK Import:

from admyral.actions import search_github_enterprise_audit_logs

Arguments

Argument NameDescriptionRequired
Enterprise enterpriseSearch Audit Logs for specified enterprise.yes
Filter filterFilter the audit logs, see Here (opens in a new tab) for additional information.-
Start Time start_timeThe date and time to start retrieving events in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). If not specified, all available Audit logs will be returned-
End Time end_timeThe date and time to stop retrieving events in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ).-
Limit limitThe maximum number of events to retrieve.-

Returns

A JSON array of audit log events.

For more information about possible audit log events, see Get the audit log for an enterprise (opens in a new tab).

Required Secrets

Secret PlaceholderDescription
GITHUB_ENTERPRISE_SECRETGitHub enterprise secret. See GitHub setup

SDK Example

audit_log_entries = search_github_enterprise_audit_logs(
	enterprise="admyral",
	filter="action:org.update_member",
	secrets={"GITHUB_ENTERPRISE_SECRET": "my_stored_github_enterprise_secret"}
)