Skip to content

API keys

API keys let scripts, SIEMs and BI tools read AuditGraph without a person signing in. Create a key with the narrowest role and scope your integration needs.

Where
Administration › API & Exports
Who
Admin only
Access granted
Read access, limited by the key's role, directory scope and scopes
Outcome
A key your integration sends with every API request
  • Decide the key’s role. A key never has the Admin role.
  • Have a secret manager ready. The key is shown once, when it is created.
Property Value
Role One of Security Admin, Security Reader, Compliance Reader, Reader — never Admin
Directory scope Optional: limit the key to one connected directory
Scopes Optional: export:read (only /v1/export/*) or detection:read (only detections and identity activity)
Expiry Default 90 days, maximum 365
Limits 50 active keys per organization; 600 requests per minute
  1. Open API & Exports.

    Go to Administration › API & Exports.

  2. Set the key’s role, directory scope, scopes and expiry.

    Use the key properties above. Choose the narrowest options that work.

  3. Store the key.

    Copy the key into your own secret manager.

    Result: the key is shown once. AuditGraph does not show it again.

Send the key in either header:

Terminal window
curl -H "X-API-Key: ag_..." https://<your AuditGraph host>/v1/...
# or
curl -H "Authorization: Bearer ag_..." https://<your AuditGraph host>/v1/...

For paging, completeness and errors, see the API reference.

  1. Create the new key.

  2. Switch your integration to the new key.

  3. Revoke the old key.

    Each key shows when it was last used, so you can confirm the old one is idle.

Creating and revoking keys is recorded in the audit history.