---
title: "Leave the workspace (ФЗ-152 §14 right-to-be-forgotten)."
method: DELETE
path: "/v1/auth/profile"
tags: ["auth"]
---

# Leave the workspace (ФЗ-152 §14 right-to-be-forgotten).

`DELETE /v1/auth/profile`

## Request

- Base URL: `https://api.andish.ru` (the document declares no server; this is the origin it was published from)
- URL: `https://api.andish.ru/v1/auth/profile`
- Auth: none declared

Soft-deletes the authenticated user. PII columns (email, password_hash) are wiped immediately. The workspace (tenant) survives if any other person in it is still alive — only the caller's own API keys are revoked in that case. If the caller was the workspace's last living person, the whole workspace is soft-deleted with them (response field workspace_deleted=true), same as before Task A4. An administrator with other living members but no other administrator is refused with 409 last_admin_cannot_leave (Task A4, docs/technical/team-mode-a4-contract-2026-09-01.md §2.2) — pass the admin role to someone else first, or remove the other members. Deletion is immediate and irreversible: there is no cooling-off period (CEO 2026-09-01). JWT-only: API-key auth returns 401 (per STRIDE A1 — keys are revoked as part of the deletion, so they cannot be the auth mechanism here). To erase the ENTIRE workspace regardless of who else is in it, use DELETE /v1/workspace (admin only).

## Response `200`

Account soft-deleted — PII wiped, sessions revoked.

- DeleteProfileResponse: Response for DELETE /v1/auth/profile (HTTP 200). Confirms the caller has been soft-deleted. Task A4 (docs/technical/ team-mode-a4-contract-2026-09-01.md) distinguishes "I left the workspace" (workspace_deleted=false — other people remain) from "I was the last person, the workspace left with me" (workspace_deleted=true). CEO 2026-09-01 frame: deletion is immediate and irreversible from the moment it is requested — there is no 30-day cooling-off / undo window. data_removal_eta describes ONLY the (currently unscheduled) physical purge of already-wiped rows — never restate the old "30 days" promise here. Wire format: {"deleted_at": "...", "data_removal_eta": "...", "workspace_deleted": false} IMPORTANT: the field name `workspace_deleted` is load-bearing — Task A1's self-arming test (tests/security/test_invite_requires_a4_gate.py) keys off this exact name to prove invites cannot ship ahead of A4. Do not rename it.
  - `deleted_at` string, date-time, required: UTC timestamp when the account was soft-deleted.
  - `data_removal_eta` string, required: Human-readable note on data removal. Personal data (email, password hash) is wiped immediately and cannot be undone; this field describes only the (not yet scheduled) physical purge of the remaining soft-deleted rows — it is never a promise that the deletion itself can be reversed.
  - `workspace_deleted` boolean: True only when the caller was the workspace's last living person and the whole workspace was soft-deleted along with them. False means the caller left and the workspace, with its documents and the other members' keys, is untouched.

## Other responses

- `401`: Missing/expired/invalid JWT, API-key auth attempted (jwt_required), or the token's user/tenant pair does not resolve (user_tenant_mismatch).
- `409`: last_admin_cannot_leave — caller is the only administrator and other members remain. Nothing was changed.
- `410`: Account already deleted (account_deleted) — token is for a ghost account.
- `429`: Rate limit exceeded (Tier 1 — 10 req/min per IP).

---

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