Skip to main content

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 ownerId and member rows disjoint.
  • The previous owner is demoted into a fresh member row or removed. It defaults to remove whenever 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 you0 when 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

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 to remove when omitted, on every path.
number
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.
WorkspaceCapability[]
On demote, the ex-owner’s capabilities.

Returns

Returns the updated Workspace object with the new ownerId.

Error codes