---
title: "Leave the organization"
method: POST
path: "/organization/leave"
tags: ["Roles and members"]
---

# Leave the organization

`POST /organization/leave`

## Request

- Base URL: `https://api.primitive.dev/v1`
- URL: `https://api.primitive.dev/v1/organization/leave`
- Auth: HTTP bearer

Removes the caller from the organization: the same removal, and the same cleanup, as an owner or admin removing them, with what they still own flagged or suspended for a decision (GET /access-suspensions). Any member may leave, whatever their role, and no permission is needed; the organization's only owner cannot, and is refused with 409 `last_owner` (make someone else an owner first). Person only: a dashboard session, or the person's own OAuth or CLI token with a session step-up of purpose `members.remove` for themselves (confirm at the link a 403 `step_up_required` answer carries in `details.step_up_url`, which names this client and you, then send the token in the Primitive-Step-Up header; the token works only with the client it was confirmed for). API keys are refused. You do not need to look up your user id: call this route once without the header, and the 403 `step_up_required` refusal names it (`details.target_user_id`) and gives the confirmation link (`details.step_up_url`). GET /whoami also returns it as `user_id` (that route needs account:read, which every built-in role holds).

## Headers

- `Idempotency-Key` string

## Response `200`

Leave the organization

- object
  - `success` true, required
  - `data` LeaveOrganizationResult, required
    - `left` true, required
    - `id` string, required

## Other responses

- `401`: Invalid or missing API key
- `403`: forbidden (`details.reason` `dashboard_only`): an API key cannot leave for a person. step_up_required: an OAuth, CLI or agent token needs a `members.remove` step-up confirmed for yourself; `details` names your user id and the confirmation link. step_up_invalid: the Primitive-Step-Up token is unknown, expired, already used, or was confirmed for another purpose, member or client (`details.reason` `step_up_client_mismatch` for another client, or none). step_up_refused: a step-up token is accepted only with your own OAuth or CLI token (never with an API key or a dashboard session, nor with a token issued for MCP).
- `404`: not_found: you are not a member of this organization (you have already left).
- `409`: last_owner: you are the only owner. conflict: you were removed, or removed and added back, while leaving.
- `429`: Rate limit exceeded. The `ratelimit-*` headers describe the limiter that rejected this request, with its own limit and window, not the API budget that successful responses report. A limiter that reports only a wait sends `Retry-After` alone.
- `500`: cleanup_incomplete: you have left, but revoking what remains of your access did not finish.
- `502`: removal_failed: the identity provider refused the removal. Nothing was changed.
- `503`: service_unavailable: leaving could not start, or did not finish; retry to finish it.
- `504`: removal_timeout: the identity provider did not answer in time; leaving may still complete.

---

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