For the complete documentation index, see llms.txt. This page is also available as Markdown.

GitHub Audit Logs via API

Overview

This document will guide you on how to create a PAT in GitHub for audit logs.

Prerequisites

Create a dedicated GitHub user account with appropriate privileges:

  • Organization Admin → for organization-level audit logs

  • Enterprise Admin → for enterprise-level audit logs

Steps to Create a PAT (Classic)

  1. Log in to GitHub with the required user account

  2. Ensure the email address is verified

  3. In the top-right corner, click your profile icon → Settings

  4. In the left sidebar, click Developer settings

  5. Navigate to:

  6. Personal access tokensTokens (classic)

  7. Click:

  8. Generate new token (classic)

  9. Provide the following details:

  10. Note: Add a descriptive name

  11. Expiration: Select an appropriate validity period (recommended: avoid “No expiration”)

  12. Under Scopes, select:

  13. ✔ read:audit_log

  14. Click Generate token

  15. Copy the token and store it securely

  16. Select the scopes you'd like to grant this token. In this case select read:audit_log

  17. Click Generate token and copy it.

Screenshot of the "Personal access tokens" page. Next to a blurred-out token, an icon of two overlapping squares is outlined in orange.

  1. To use your token to access resources owned by an organization that uses SAML single sign-on, authorize the token. For more information, see Authorizing a personal access token for use with single sign-on.

Once PAT is created, please share the token with blusapphire.