---
title: "Leave a team"
method: DELETE
path: "/api/v1/teams/{team}/leave"
---

# Leave a team

`DELETE /api/v1/teams/{team}/leave`

Removes a principal from a team. By default, the authenticated user removes
themselves from the team. Provide `agent` to remove an agent instead — the
caller must be a member of the team to do so.

Team owners cannot leave their own team. To transfer ownership first, use
the update-membership endpoint, then call this endpoint.

For server-to-server requests, `user` is required to identify which user
should be removed.

## Path parameters

- `team` string, required

## Response `204`

No content

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not a member of this team
- `422` — Failed to leave team

---

[API](https://skmtc.net/archastro/apis/archastro-platform-api.md) · [All operations](https://skmtc.net/archastro/apis/archastro-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/archastro/archastro-platform-api/versions/a8772b442f86/schema)
