Overview
useRemoveWorkspaceMemberFromSubtree returns a callable that removes a user’s direct memberships on this workspace and every descendant you can reach, in one action. Each deletion fires workspace.member.removed.
Authorization: capability-gated + rank-bounded, evaluated per node. Requires remove-member, and the sweep is refused if you are outranked by the target at any node where you both hold a direct member row. An owner (or ancestor owner) reaches the whole subtree via the god-path; a non-owner only reaches descendants through an unbroken open inherit chain, so a sealed sub-workspace (inheritsFromParent = false) is left untouched for a non-owner.
Usage Example
Parameters
string
required
The workspace UUID — the subtree root.
string
required
The target user to offboard — a path param, not an acting user.
Returns
Reading skipped
Each entry names a descendant where the target is still a member after this call.
id/namearenullwhen you have no standing on that workspace. The call tells you a membership survived without disclosing the existence or name of a sealed sub-workspace you have no authority over — the same sealing fenceuseFetchWorkspaceMembersapplies toinclude=descendants. Escalate to an owner or ancestor owner of that branch.reasonis currently always"out-of-reach".- Only descendants where the target actually still holds a direct membership are listed — unreachable descendants they were never in are never disclosed.
Reading the owned-workspaces block
The 409 body carriesownedWorkspaces: { id: string | null; name: string | null }[] and ownedCount: number (the number of entries in ownedWorkspaces). Entries for workspaces you have standing on carry id and name and are always reported. Owned workspaces you have no standing on are reported as { id: null, name: null }, and only when the target holds a membership this call would remove; otherwise they are left out. Named entries come first, in tree order, then the anonymous ones. Only an owner can transfer ownership, so anonymous entries mean you need an owner of this workspace to resolve them.
Error codes
Related
useRemoveWorkspaceMember— this node only- Remove From Subtree API

