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’s existing member row (if any) is removed, keeping
ownerIdand member rows disjoint. - The previous owner is demoted into a fresh member row or removed. It defaults to
removewhen an ancestor owner reassigns; on a voluntary self-transfer the outgoing owner chooses. On demote, rank defaults to0.
Usage Example
Parameters
string
required
The workspace UUID.
string
required
The new owner — any verified user in the tenant. This is the transfer target, not an acting user.
"demote" | "remove"
What happens to the outgoing owner. Defaults server-side (ancestor-owner reassign →
remove).number
On demote, the ex-owner’s rank. Defaults to
0.WorkspaceCapability[]
On demote, the ex-owner’s capabilities.
Returns
Returns the updated Workspace object with the newownerId.

