Audit record structure
Principal
Theprincipal object identifies who performed the query:
- User query (SAML/OIDC):
typeisuser.user_idanduser_emailare populated from the identity provider’s claims.idp_session_idis populated if the IdP includes a session identifier in the token. - Service account query (API key):
typeisservice_account.api_key_idandservice_account_nameare populated. User fields are null.
identifiers_queried
The number of identifiers submitted in the request. The actual identifier values are not stored in the audit log; only the count. This limits PII exposure in the audit trail while preserving accountability.
If you need to correlate an audit record back to the specific identifiers queried, use the request_id to retrieve the full lookup result via GET /v1/lookup/{request_id} (subject to your configured result retention period).
Querying the audit log
UseGET /v1/audit to retrieve records:
next_cursor is present in the response, pass it as ?cursor= to retrieve the next page.
Retrieving a single audit record
Retention
The default audit retention period is 7 years (2,555 days). This is configurable viaAUDIT_RETENTION_DAYS but cannot be set to zero; the engine enforces a minimum retention period of 1 year.
Records older than the retention period are purged automatically during scheduled maintenance windows.
Access control
Audit log access is restricted to principals with theaudit:read permission scope. By default this is granted to:
- Service accounts with the
auditrole - SSO users whose IdP groups map to the
auditrole in the engine’s role configuration
Correlation with your IdP logs
Theidp_session_id field allows you to correlate audit records with your identity provider’s own session and access logs. For SAML deployments, this corresponds to the SessionIndex in the assertion. For OIDC deployments, this is the sid or jti claim if your IdP includes one.
This is particularly useful when responding to a security incident: you can trace a suspicious query in the audit log back to the user’s IdP session and from there to their full authentication history in your IdP.