---
title: "Leave Team"
method: POST
path: "/v2/teams/leave"
tags: ["Teams"]
---

# Leave Team

`POST /v2/teams/leave`

## Request

- Base URL: `https://api.village.ai`
- URL: `https://api.village.ai/v2/teams/leave`
- Auth: HTTP bearer

Leave a team you are a member of. Removes your membership from the team. If you are the last member of a non-paid team, leaving deletes the team and all of its lists, projects and sequences: the call is refused with 409 (naming what would be deleted) unless delete_workspace is true, which you send only after the user has agreed. Admins of paid teams cannot leave — use Cancel Plan instead. Admins of non-paid teams must remove all other members before leaving. If the team you leave is your active workspace, your next team becomes active and its id is returned as selected_team_id.

## Request body

- LeaveTeamRequest: Request body for leaving a team
  - `team_id` string, required
  - `delete_workspace` boolean: Required as true when you are the last member: leaving then deletes the workspace and all of its lists, projects and sequences. Send it only after the user has agreed.

## Response `200`

Successfully left team

- object
  - `data` LeaveTeamResponse, required: Response after leaving a team
    - `success` boolean, required
    - `message` string, required
    - `warnings` string[]
    - `selected_team_id` string, nullable: The caller's active workspace after leaving: their next team when the one they left was active, otherwise unchanged; null when they have no team left
  - `metadata` object, required
    - `request_id` string, required

## Other responses

- `400`: Admin cannot leave (paid team or other members exist)
- `401`: Unauthorized - missing or invalid authentication
- `404`: User is not a member of this team

---

[API](https://skmtc.dev/village/apis/village-v2-api.md) - [All operations](https://skmtc.dev/village/apis/village-v2-api/llms.txt) - [OpenAPI document](https://skmtc.dev/village/apis/village-v2-api/revisions/aebe21a1a544?raw)
