Why Audit Logs Matter
Security investigations
When something goes wrong, trace exactly what happened, when, and who was responsible.
Compliance requirements
SOC 2, HIPAA, GDPR, and other frameworks require audit trails for sensitive operations.
Team visibility
Know when team members create, modify, or revoke keys — especially critical in shared workspaces.
Debugging
Figure out why a key stopped working, when a permission was changed, or who updated configuration.
What Gets Logged
Unkey automatically logs every mutation operation. Read operations are not logged — only actions that create, update, or delete resources.Logged Events by Category
- API Keys
- APIs
- Identities
- Rate Limiting
- Workspace
- Webhooks
| Event | Description |
|---|---|
key.create | A new API key is created |
key.update | Key properties are modified (name, metadata, limits, etc.) |
key.delete | A key is permanently deleted |
key.reroll | A key is replaced with a new value while preserving config |
Verification events (key.verify) are tracked in Analytics, not audit logs. Audit logs focus on configuration changes, not runtime operations.
Accessing Audit Logs
Dashboard
Navigate to Audit Logs
Sign into app.unkey.com and click Audit Logs in the sidebar

Log Entry Details
Each audit log entry contains:| Field | Description |
|---|---|
| Time | Precise timestamp when the change occurred (ISO 8601 format) |
| Actor | Who made the change — a user (via dashboard) or root key (via API) |
| Action | The operation type: Create, Update, Delete, etc. |
| Event | What was affected: key, permission, api, identity, etc. |
| Resource ID | The ID of the affected resource (key ID, API ID, etc.) |
| Description | Human-readable summary of the change |
| Request | Full request payload (what was sent) |
| Response | Full response payload (what was returned) |
| Metadata | Additional context (IP address, user agent, etc.) |

Filtering Audit Logs
Use filters at the top of the audit log page to narrow down results:- By Event Type
- By Actor
- By Time Range
- By Resource
Filter by specific event categories:
- Keys: Only key-related events
- Permissions: Authorization changes
- Rate Limits: Rate limit configuration
- Workspace: Workspace-level changes
Common Use Cases
Security incident investigation
Security incident investigation
Scenario: A key was compromised and you need to understand the blast radius.
Export evidence: Click “Export” to download logs for security reports.
Compliance auditing
Compliance auditing
Scenario: Annual SOC 2 audit requires proof of access controls.Generate reports showing:
- All permission changes in the audit period
- Who granted/revoked access
- When keys were created/deleted
- Rate limit policy changes
- Permission Changes
- Key Lifecycle
Filter by:
permission.createpermission.deleteauthorization.*
Debugging configuration issues
Debugging configuration issues
Scenario: A key suddenly stopped working and the user claims they didn’t change anything.
Identify the change
Common culprits:
enabledset tofalseexpirestimestamp in the past- Rate limit reduced to 0
- Permission removed
Team activity monitoring
Team activity monitoring
Scenario: You want to see what your team has been doing this week.Filter by:
- Time range: Last 7 days
- Actor: Each team member
- Onboarding review (did new hire create test keys?)
- Activity verification (is contractor still making changes?)
- Change management (what changed during the deployment?)
Automated system changes
Automated system changes
Scenario: Track changes made by automated systems or CI/CD.Filter by:
- Actor: Specific root key ID used by automation
- Are automated deploys creating/updating keys correctly?
- Did the migration script run successfully?
- Are rate limits being set programmatically as expected?
Log Retention
Audit logs are retained based on your plan:| Plan | Retention Period | Export |
|---|---|---|
| Free | 7 days | ✓ |
| Pro | 90 days | ✓ |
| Enterprise | Custom (up to unlimited) | ✓ with custom formats |
Exporting Logs
- Dashboard Export
- API Export (Enterprise)
- Continuous Export (Enterprise)
- Apply desired filters
- Click Export button
- Choose format: CSV or JSON
- Download begins automatically
Best Practices
Review logs regularly
Check audit logs weekly for unusual activity:
- Unexpected deletions
- Permission escalations
- Bulk changes
- Off-hours modifications
Use root keys sparingly
Root keys have full workspace access. Create narrow-scoped root keys for automation:
Export for compliance
If you need logs older than your retention period:
- Set up automated monthly exports
- Store in S3 or compliance vault
- Include in annual audit packages
Name root keys descriptively
When creating root keys, use clear names:
CI/CD Production DeployStripe Webhook HandlerAnalytics Export Script
Monitor for bulk changes
Set up alerts for:
-
10 keys deleted in 1 hour
-
50 keys created in 1 hour
- Mass permission changes
Document procedures
Create runbooks for:
- How to investigate security incidents
- Where to find specific log types
- Export procedures for auditors
- Retention policy documentation
Audit Log vs Analytics
Understand the difference:| Feature | Audit Logs | Analytics |
|---|---|---|
| Purpose | Track configuration changes | Track runtime usage |
| Events | Create, update, delete | Key verifications |
| Volume | Low (only mutations) | High (every API call) |
| Retention | 7-90+ days | 7-90+ days |
| Use for | Security, compliance, debugging | Usage patterns, billing, optimization |
- Audit logs answer “who changed what?”
- Analytics answer “how is it being used?”
Security Considerations
Audit logs are immutable
Audit logs are immutable
Once created, audit log entries cannot be modified or deleted by users. This ensures integrity for compliance and security investigations.
Actor attribution
Actor attribution
Every change is attributed to:
- User: Dashboard changes show user email
- Root key: API changes show root key ID and name
Request/response payloads
Request/response payloads
Full payloads are captured, which may include:
- Key values (only on creation)
- Metadata
- Configuration
Data privacy
Data privacy
For GDPR/CCPA compliance:
- Don’t store PII in key names or metadata
- Request deletion via [email protected]
- Logs for deleted resources remain (shows deletion event)
Enterprise Features
Enterprise plans include advanced audit log capabilities. Contact us to learn more.
Extended retention
Keep logs for years, not days:
- 1 year standard
- Multi-year available
- Unlimited retention for regulated industries
SIEM integration
Stream logs to security tools:
- Datadog
- Splunk
- Sumo Logic
- Custom webhooks
Advanced filtering
More powerful queries:
- Regex search
- Complex boolean logic
- Custom field matching
- SQL-like queries
Compliance reports
Automated report generation:
- SOC 2 evidence
- HIPAA audit trails
- Custom compliance formats
- Scheduled exports
Next Steps
Analytics
Track key usage and verification patterns
Security Overview
Learn how Unkey protects your data
Root Keys
Create and manage root keys for API access
API Reference
Complete API documentation