v2
latestOpenAPI 3.1.02026-08-05267431678.1 KBLeave Team
Leave a team voluntarily.
Routes to :func:sole_member_leave_team_atomic when the caller is the only member (no transfer plan required) and to :func:leave_team_atomic otherwise. Owners cannot leave without transferring ownership first — the lifecycle helper raises 400 in that case.
Args: team_id: Team the caller is leaving. body: Optional {transfer_plan: {resource_type: {row_id: target|"delete"}}}. Required for multi-member teams when the caller owns rows; ignored for sole-member teams. auth: Authenticated user context.
Returns: :class:TeamLeaveResponse. new_active_team_id is the team the caller's active-team snapped to (earliest remaining membership) or None when they have none left.
Raises: HTTPException: 400 if the caller is the team owner; 404 if not a member; 409 with {detail: "owned_resources_unresolved", unresolved: {...}} when the transfer plan is incomplete; 409 transfer_target_not_member when a target is not a current member.
Path parameters
Request body
Response
Successful Response