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
Before you begin
Section titled “Before you begin”- 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.
Key properties
Section titled “Key properties”| 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 |
Create a key
Section titled “Create a key”-
Open API & Exports.
Go to Administration › API & Exports.
-
Set the key’s role, directory scope, scopes and expiry.
Use the key properties above. Choose the narrowest options that work.
-
Store the key.
Copy the key into your own secret manager.
Result: the key is shown once. AuditGraph does not show it again.
Use a key
Section titled “Use a key”Send the key in either header:
curl -H "X-API-Key: ag_..." https://<your AuditGraph host>/v1/...# orcurl -H "Authorization: Bearer ag_..." https://<your AuditGraph host>/v1/...For paging, completeness and errors, see the API reference.
Rotate and revoke
Section titled “Rotate and revoke”-
Create the new key.
-
Switch your integration to the new key.
-
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.