← Back to Compliance Center
👁

Audit Logging

Immutable, SOC 2 compliant event logging — who did what, when, and from where.

Last reviewed 2026-04 · Engineering · Owned by AI Safety Officer

On this page

  1. Overview
  2. Immutability guarantee
  3. What is logged
  4. Entry structure
  5. Querying
  6. Exporting
  7. Retention
  8. Related documents

Overview

Every significant action in Votriz is recorded in an immutable audit log. The log cannot be modified or deleted — a database trigger physically prevents UPDATE and DELETE operations even from a database superuser. This satisfies SOC 2 Trust Service Criteria CC7.1 (system monitoring) and CC7.2 (anomaly detection).

Immutability guarantee

The security_audit_log table is protected by a trigger that raises on any modification attempt:

CREATE TRIGGER no_audit_update BEFORE UPDATE OR DELETE ON security_audit_log FOR EACH ROW EXECUTE FUNCTION prevent_audit_modification(); -- ERROR: security_audit_log is immutable — UPDATE and DELETE are prohibited

This means:

What is logged

CategoryActions
Authenticationlogin, login_failed, password_change, password_reset, mfa_setup_initiated, mfa_enabled, mfa_login_succeeded, mfa_login_failed, mfa_disabled, mfa_recover_started, mfa_recovered
Contentcreate, approve, reject, edit, publish, delete
Emailcampaign_create, campaign_send, subscriber_delete, lead_generate
Channelsconnect, disconnect, token_refresh
Membersinvite, remove, role_change, permission_grant
Billingplan_change, checkout_initiated, portal_opened, payment_failed, cancel
Settingsupdate, white_label_change, export_data
AIquality_report
Securityisolation_proof_viewed, drill_completed

Entry structure

FieldDescription
log_idSequential bigint — proves ordering, no gaps
org_idWhich organization
user_idWho performed the action (NULL for system actions)
user_emailDenormalized — survives user deletion
user_roleRole at time of action
ip_addressClient IP
user_agentBrowser / API client
actionWhat happened (e.g. content.approve)
resource_typeWhat was affected (content, brand, …)
resource_idSpecific resource UUID
detailsAction-specific JSONB context
request_idCorrelation id matching the response's X-Request-Id header and the access log
created_atUTC timestamp

Querying

Owner and admin roles can query the log via the API or in the dashboard under System → Audit Log.

GET /audit/log?action=auth.login&start_date=2026-04-01&limit=50 Authorization: Bearer <owner-token>

Available filters: action, user_id, resource_type, resource_id, ip_address, start_date, end_date. Pagination via limit + offset (limit capped at 500 per page).

Aggregate dashboard data

GET /audit/log/summary?days=30 Authorization: Bearer <owner-token>

Returns total events, unique IPs, failed-auth count, by-category counts, and the top 10 active users.

Exporting

Owners can export the full audit log as CSV or JSON for compliance review or long-term archival:

GET /audit/log/export?format=csv&start_date=2026-01-01 Authorization: Bearer <owner-token> # Filename: votriz_audit_log_YYYYMMDDTHHMMSSZ.csv

Export is owner-only (admins can read but not export). Date range is optional; without it you get everything since account creation.

Retention

Audit log entries are retained for 7 years — the SOC 2 evidence window. Entries are never automatically purged. The immutability trigger ensures historical entries remain unchanged regardless of account status, deletion requests, or backup rotation. This is intentional: data deletion under GDPR Art 17 covers personal data the customer produced, not the audit trail of what happened to that data.

Related documents

Questions or a custom security review?

Enterprise customers receive dedicated security reviews and direct access to our security team. Reach us anytime at [email protected].

Talk to security →