Skip to content

audit_exported

This page is auto-generated from src/auth/stytch-invite.ts. Do not edit by hand — see docs/dev/docs-auto-sync.md.

audit_exported

FunctionSource
encodeAuditExportedAuditReasonsrc/auth/stytch-invite.ts:639
FieldTypeRequiredNotes
by_user_idstringyes
from_datestringyes
to_datestringyes
row_countnumberyes

#408 — Org-scoped audit log UI export envelope.

Emitted by the new dashboard CSV export endpoint (GET /admin/ui/orgs/:slug/audit/export.csv) so the export is itself an auditable action — operators can prove, after the fact, who pulled which window. Same JSON-into-decision_reason shape as the rest of the file.

from_date / to_date are ISO-8601 strings (UTC) for the requested window. row_count is the number of rows actually streamed (post-filter, post-tier-clamp). by_user_id follows the same sentinel-on-admin-token pattern as every other envelope. PII surface: just the operator identity (already on every other envelope) plus the window — nothing per-package.

This envelope is stored in audit_log.decision_reason (varchar(256)) as a JSON object with the shape { event, ...ctx }. The audit_log row carries tenant_id, actor_user_id, and timestamp as columns alongside — those are not duplicated in the envelope.