Skip to content

Leave a team

DELETE
/api/me/teams/{id}/
curl --request DELETE \
--url http://localhost:8000/api/me/teams/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/ \
--header 'Authorization: Bearer <token>'

Removes the signed-in coach’s membership in the given team. Owners can’t leave a team that still has other members via this endpoint — they must transfer ownership first or use the nuclear DELETE /api/me/ (which cascades every team they own). 404 if the caller has no membership on the given team; 403 if an owner tries to leave this way.

id
required
string format: uuid

No response body

Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string
Examplegenerated
{
"detail": "example"
}
Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string
Examples
Example403—OwnerCan'tLeaveViaThisEndpoint

403 — Owner can't leave via this endpoint

{
"detail": "Owners can't leave via this endpoint — delete the account or transfer ownership."
}
Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string
Examples
Example404—NotATeamYouBelongTo

404 — Not a team you belong to

{
"detail": "team_not_found"
}