---
title: "Leave Team"
method: POST
path: "/v1/teams/{team_id}/leave"
tags: ["teams"]
---

# Leave Team

`POST /v1/teams/{team_id}/leave`

## Request

- Base URL: `https://api.pioneer.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pioneer.ai/v1/teams/{team_id}/leave`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/pioneer/apis/brain-api/docs/v1/teams/:team_id/leave/post.ts> (a function with typed inputs; its response is checked against the schema)

Leave a team.

Args:
    team_id: Team identifier.
    auth: Authenticated caller.
    body: Optional resource transfer plan.

Returns:
    Leave-team outcome.

Raises:
    HTTPException: If resources or transfer targets are unresolved.

## Path parameters

- `team_id` string, required

## Request body

- LeaveTeamRequest: Optional transfer plan accompanying a leave-team request. The plan resolves every row the leaving user owns in the team: transfer to another current member (any role) by user UUID, or ``"delete"`` to remove the row inside the leave transaction. Sole-member leaves omit the plan entirely. Attributes: transfer_plan: ``{resource_type: {row_id: target_user_id|"delete"}}``. Empty/absent when the user owns nothing or is the sole member of the team.
  - `transfer_plan` object

## Response `200`

Successful Response

- TeamLeaveResponse: Response model for leaving a team.
  - `success` boolean, required
  - `message` string, required
  - `team_id` string, required
  - `new_active_team_id` string, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-24** `0e5e86e2bae5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pioneer/apis/brain-api/changes/v1/teams/:team_id/leave/post.md)

---

[API](https://skmtc.dev/pioneer/apis/brain-api.md) - [All operations](https://skmtc.dev/pioneer/apis/brain-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pioneer/apis/brain-api/revisions/0e5e86e2bae5?raw)
