Skip to content

owner_transferred

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

owner_transferred

FunctionSource
encodeOwnerTransferredAuditReasonsrc/auth/stytch-invite.ts:119
FieldTypeRequiredNotes
from_member_idstringyes
from_stytch_member_idstringyes
to_member_idstringyes
to_stytch_member_idstringyes
by_user_idstringyes

#423 / #398c — emitted by POST /api/v1/admin/orgs/:slug/transfer-ownership. from_member_id / to_member_id are the tenant_members.id values of the outgoing and incoming owner rows; the matching *_stytch_member_id fields are the cached Stytch ids on those rows. The transfer ran inside a single DB transaction so the two role updates either both commit or both roll back; the partial unique index on tenant_members enforces the one-owner-per-tenant invariant regardless of how mid-transfer crashes interleave.

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.