---
title: "Leave team"
method: DELETE
path: "/api/user/teams/{id}/leave"
tags: ["Teams"]
---

# Leave team

`DELETE /api/user/teams/{id}/leave`

## Request

- Base URL: `https://demo.hitkeep.com`
- URL: `https://demo.hitkeep.com/api/user/teams/{id}/leave`
- Auth: API key in cookie `hk_token`

Removes the authenticated user from the specified team and returns the new active team.

## Path parameters

- `id` string, uuid, required

## Response `200`

Leave team response

- TeamLeaveResponse
  - `active_team_id` string, uuid
  - `recent_team_ids` string[]
  - `status` string

## Other responses

- `400`: Cannot leave your only team or last owner
- `403`: Access denied

---

[API](https://skmtc.dev/hitkeep/apis/hitkeep-rest-api.md) · [All operations](https://skmtc.dev/hitkeep/apis/hitkeep-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hitkeep/apis/hitkeep-rest-api/revisions/bb2df36ab2a4?raw)
