Overview
useTransferWorkspaceOwnership returns a callable that reassigns a workspace’s ownerId.
Authorization: owner-only. The signed-in user must be this workspace’s own owner or any ancestor owner — never a capability or reach. (Ancestor-owner transfer is what makes offboarding resolvable: a manager can reassign a departing member’s owned sub-workspace without that member’s cooperation.)
- The new owner must be a verified user in the tenant — they need not already be a member.
- The new owner stops being a member, if they were one: their rank, capabilities and permissions here are dropped, while their
titleandmetadatastay, as the owner’s profile. - The previous owner is demoted into a member row, keeping the
titleandmetadatathey had as owner, or removed, losing them. It defaults toremovewhenever the field is omitted — on a voluntary self-transfer as much as on an ancestor-owner reassign; pass"demote"to keep them on the roster. On demote, rank defaults to one rung below you —0when you are apex (the usual case), or one below your own row if you are an ancestor owner who also sits in this workspace’s ladder.
Usage Example
Parameters
The new owner — any verified user in the tenant. This is the transfer target, not an acting user.
What happens to the outgoing owner. Defaults to
remove when omitted, on every path.On demote, the ex-owner’s rank. Absolute only — no relative form. Defaults to one rung below your own anchor:
0 when you are apex (an owner or ancestor owner with no member row here), or yourRank + 1 when you do hold a row here, so the default never seats the outgoing owner above you. An explicit value is honored verbatim.Returns
Returns the updated Workspace object with the newownerId.

