Skip to content

stytch_tenant_auto_created

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

stytch_tenant_auto_created

FunctionSource
encodeStytchAutoCreateAuditReasonsrc/auth/stytch-login.ts:608
FieldTypeRequiredNotes
stytch_org_idstringyes
stytch_org_namestringyes
tierstringyes
by_user_idstringyes

Encode the auto-create audit_log row’s decisionReason envelope. The audit_log column is varchar(256) — same constraint encodeRoleOverrideAuditReason works around. We truncate defensively, though the realistic payload is ~150 chars.

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.