Audit log

Every important action on a doc and across an org is recorded with actor, event type, and timestamp. Used for the History panel, the org audit page, and compliance review.

4 min read

sweetdocs writes an audit event for every meaningful action on a document: saves, shares, public-link toggles, restores, comments, edits by collaborators. Org-level events extend the same schema (member changes, library creates, domain captures).

These events power three distinct UI surfaces:

SurfaceScopeAudience
Doc History panelOne documentAnyone with read access to the doc
Org audit pageWhole organizationOrg Owners + Admins
Search / dashboards (internal)Compliance and securitysweetdocs operators when investigating issues
All eventsVersionsSharesMembersLast 7 days
ActorActionResourceTime
L Lee VaniderstineSaved a versionkyoto-trip2m ago
S Sam ParkShared accessArchitecture14m ago
L Lee VaniderstineMade publicPricing notes1h ago
A Avery ChenRestored a versionAuth migration plan3h ago
@ [email protected]Domain captureOrgyesterday

Event types

Every event has a event_type, a payload (JSON with event-specific fields), and a created_at. The current types:

Event typeDoc-scoped labelOrg-scoped label
versionVersion savedSaved a version
viewViewedViewed
shareShared <level> with someone / a groupShared access
unshareRevoked <level> accessRevoked access
public_onMade public (share link enabled)Made public
public_offMade private (share link disabled)Made private
restore / version_restoredRestored a previous versionRestored a version
comment_receivedNew commentCommented
comment_repliedReplied to a commentReplied
mentionedMentioned a collaboratorMentioned someone
doc_edited_by_collaboratorEdited by a collaboratorEdited

The labels are deliberately written two ways: the doc-scoped version reads like “what happened to this doc,” the org-scoped version reads like “what this person did.”

Doc-level audit (the History panel)

The History panel (right-side, clock icon in the toolbar) shows the audit timeline for the current document. Each row is one event.

Versions are clickable to preview / restore; non-version events are read-only timeline markers.

This is per-doc, per-user. Anyone with read access sees the same timeline.

Org-level audit

For orgs, an aggregate view of every event across every doc, folder, library, and member is available on the org page. This is Owner + Admin only. Members don’t see other people’s actions.

What’s covered org-wide:

  • All the doc-scoped events above (across every doc in the org’s libraries)
  • Membership changes (added, role updated, removed, ownership transferred)
  • Group changes (created, members added / removed, deleted)
  • Library changes (created, renamed, sharing-mode changed, deleted)
  • Domain captures (every auto-join via domain capture)
  • Sign-in events (recorded with timestamp, IP, user agent)
  • Sign-out events (including sign-out-everywhere)

What’s recorded with each event

Every event row includes:

FieldValue
actorWho did it (user ID + display name + avatar)
event_typeThe action type (from the table above)
payloadEvent-specific metadata as JSON
created_atWhen it happened (UTC, displayed in viewer’s local time)
resourceThe doc / folder / library / org targeted (for actions on resources)

For sign-in events, IP address and user-agent string are also captured for security review.

Retention

Audit events are retained according to your plan’s data retention policy:

  • Free / Pro: Personal audit only (your own History panel). No long-term org audit because there’s no org. Local audit is kept as long as the resource exists.
  • Teams: Full org audit retained for the duration of the subscription, plus standard data retention after cancellation.

Export to CSV

Org Owners and Admins can export the audit log as CSV from the org audit page. Useful for:

  • Compliance reviews (SOC 2, ISO, GDPR)
  • Internal investigations (who modified this doc when)
  • Reporting to insurance providers after a security event

The CSV includes every column shown in the UI plus the full payload JSON for each event.

What the audit log isn’t

NotWhy
A way to see “all access to a document” by readers (public link viewers)Public link views are recorded as anonymous view events with no actor
Real-time alertsThe log is post-hoc; set up notifications separately if you need them
Tamper-proof / blockchain-styleThe DB is the source of truth; we don’t write to an append-only log outside Postgres
Free / Pro org auditFree/Pro doesn’t have orgs
Real session activity (every API call, every keystroke)Only meaningful semantic events are recorded, not every individual HTTP request

Compliance posture

For SOC 2 / ISO 27001-style audits, the org audit log is the primary artifact. It captures:

  • Identity (who took the action)
  • Action (what type of event)
  • Object (which resource was affected)
  • Time (when it happened)
  • IP/UA for sign-in events

This is the standard four-W audit shape and meets most “log every administrative action” requirements.