Affinity Design
Agency Guide

Audit Logs & Activity Tracking

Platform-wide audit trails for admin actions, agent operations, and data changes

Overview

The platform maintains audit trails across all major operations — admin actions, agent runtime events, billing changes, and website executions. Audit logs provide accountability, debugging context, and compliance support.

What Gets Logged

Admin Actions

All admin API writes are logged with:

FieldDescription
actionWhat was done (e.g., client.create, agent.update, user.delete)
actorWho performed the action (admin user ID)
resourceWhat was affected (resource type + ID)
timestampWhen the action occurred
changesBefore/after state for updates

Agent Runtime Events

SEO agent operations emit seo.* audit events:

EventMeaning
seo.campaign.queuedA campaign was queued for execution
seo.campaign.startedWorker claimed the campaign
seo.campaign.completedCampaign finished successfully
seo.campaign.failedCampaign failed
seo.campaign.cancelledCampaign was cancelled
seo.action.completedA sub-agent action finished

Website Execution Events

All website job lifecycle transitions are logged:

EventMeaning
website_execution.job.createdJob persisted
website_execution.job.preview_readyPreview available
website_execution.job.runningWorker started execution
website_execution.job.completedExecution succeeded
website_execution.job.failedExecution failed
wordpress.entity.writeWordPress content was written
github.change_set.appliedGitHub commit was made

Billing Events

Stripe webhooks mirror charge, invoice, and subscription state changes into the audit log with full event metadata.

Viewing Audit Logs

Via Admin UI

  1. Navigate to Admin → Audit Logs
  2. Filter by action type, actor, resource, or date range
  3. View detailed event records with full change metadata

Via API

# List audit logs
GET /admin/audit-logs?actor=USER_ID&action=client.create&from=2026-05-01&to=2026-05-05

# Get a specific audit entry
GET /admin/audit-logs/ENTRY_ID

Activity Records

Website execution uses shared activity records instead of a separate history store. Activity records include:

  • Event key — standardized identifier (e.g., website_execution.job.completed)
  • Statusinfo, success, warning, or error
  • Summary — human-readable description
  • Metadata — structured data specific to the event type
  • Timestamp — when the event occurred

Retention

Audit logs are retained indefinitely by default. For high-volume deployments:

  • Archive logs older than 90 days to cold storage
  • Maintain a summary index for long-term reporting
  • Never delete audit logs that may be needed for compliance

Compliance Considerations

Audit logs capture who did what and when. They do not store raw API keys, tokens, or secrets. Sensitive fields in logged payloads are redacted.

For compliance-sensitive deployments:

  1. Ensure audit log access is restricted to authorized admins
  2. Enable log export for external SIEM or compliance tools
  3. Configure retention policies to meet regulatory requirements
  4. Verify that all admin actions produce audit entries

Troubleshooting

IssueResolution
Missing audit entriesSome legacy actions may not emit events — check the specific feature documentation
Cannot access audit logsOnly super_admin and admin roles can view audit logs
Logs too large to browseUse date range and action type filters to narrow results
Redacted fields in entriesSensitive fields (tokens, passwords, secrets) are automatically redacted

On this page