Skip to main content
Audit logs capture every mutation in your Unkey workspace — key creation, permission changes, revocations, rate limit updates, and more. They’re essential for security investigations, compliance requirements, and understanding who changed what and when.

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

EventDescription
key.createA new API key is created
key.updateKey properties are modified (name, metadata, limits, etc.)
key.deleteA key is permanently deleted
key.rerollA 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

1

Navigate to Audit Logs

Sign into app.unkey.com and click Audit Logs in the sidebar
2

Browse events

See a chronological list of all workspace mutations
3

Click for details

Click any row to see complete request/response payloads and metadata
Audit log list view

Log Entry Details

Each audit log entry contains:
FieldDescription
TimePrecise timestamp when the change occurred (ISO 8601 format)
ActorWho made the change — a user (via dashboard) or root key (via API)
ActionThe operation type: Create, Update, Delete, etc.
EventWhat was affected: key, permission, api, identity, etc.
Resource IDThe ID of the affected resource (key ID, API ID, etc.)
DescriptionHuman-readable summary of the change
RequestFull request payload (what was sent)
ResponseFull response payload (what was returned)
MetadataAdditional context (IP address, user agent, etc.)
Detailed audit log view

Filtering Audit Logs

Use filters at the top of the audit log page to narrow down results:
Filter by specific event categories:
  • Keys: Only key-related events
  • Permissions: Authorization changes
  • Rate Limits: Rate limit configuration
  • Workspace: Workspace-level changes
Useful for tracking specific types of changes.

Common Use Cases

Scenario: A key was compromised and you need to understand the blast radius.
1

Find when the key was created

Filter logs by key.create and search for the key ID
2

Check if it was modified

Look for key.update events — was it given extra permissions?
3

See who had access

Check the actor field — was it created via API or dashboard?
4

Verify revocation

Confirm key.delete or key.update (enabled=false) event exists
Export evidence: Click “Export” to download logs for security reports.
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
Filter by:
  • permission.create
  • permission.delete
  • authorization.*
Export as CSV for auditor review.
Scenario: A key suddenly stopped working and the user claims they didn’t change anything.
1

Search for the key ID

Filter audit logs by resource ID
2

Look for recent changes

Check for key.update events in the past 7 days
3

Identify the change

Common culprits:
  • enabled set to false
  • expires timestamp in the past
  • Rate limit reduced to 0
  • Permission removed
4

Check who made the change

Was it a team member, API call, or automated process?
Scenario: You want to see what your team has been doing this week.Filter by:
  • Time range: Last 7 days
  • Actor: Each team member
Useful for:
  • Onboarding review (did new hire create test keys?)
  • Activity verification (is contractor still making changes?)
  • Change management (what changed during the deployment?)
Scenario: Track changes made by automated systems or CI/CD.Filter by:
  • Actor: Specific root key ID used by automation
Monitor:
  • 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:
PlanRetention PeriodExport
Free7 days
Pro90 days
EnterpriseCustom (up to unlimited)✓ with custom formats
After the retention period, logs are permanently deleted and cannot be recovered. Export logs regularly if you need longer retention.

Exporting Logs

  1. Apply desired filters
  2. Click Export button
  3. Choose format: CSV or JSON
  4. Download begins automatically
Exports include all filtered events with complete payloads.

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:
// Good: Limited scope
permissions: ["key.create", "key.update"]

// Bad: Full access
permissions: ["*"]

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 Deploy
  • Stripe Webhook Handler
  • Analytics Export Script
Makes audit logs much easier to understand.

Monitor for bulk changes

Set up alerts for:
  • 10 keys deleted in 1 hour
  • 50 keys created in 1 hour
  • Mass permission changes
Could indicate compromise or runaway script.

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:
FeatureAudit LogsAnalytics
PurposeTrack configuration changesTrack runtime usage
EventsCreate, update, deleteKey verifications
VolumeLow (only mutations)High (every API call)
Retention7-90+ days7-90+ days
Use forSecurity, compliance, debuggingUsage patterns, billing, optimization
Both are important:
  • Audit logs answer “who changed what?”
  • Analytics answer “how is it being used?”

Security Considerations

Once created, audit log entries cannot be modified or deleted by users. This ensures integrity for compliance and security investigations.
Every change is attributed to:
  • User: Dashboard changes show user email
  • Root key: API changes show root key ID and name
Never share root keys between systems — create separate keys for accurate attribution.
Full payloads are captured, which may include:
  • Key values (only on creation)
  • Metadata
  • Configuration
Never put secrets in metadata or key names.
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

Build docs developers (and LLMs) love