# Delete Current User

> Delete the workspaces that go with the caller's account (PlatDev #4423).

Canonical URL: https://docs.botyard.io/docs/api/users/delete_current_user_v1_users_me_delete

`DELETE /v1/users/me`

Delete the workspaces that go with the caller's account (PlatDev #4423).

Called by the auth service's better-auth ``beforeDelete`` hook, after the
person has re-authenticated and just before the login itself is deleted.
Workspaces the caller is the only member of are deleted, through the same
cascade as ``DELETE /v1/orgs/{id}``. Refused with 409 when the caller is the
only owner of a workspace that has other members; then nothing changes and
the auth service keeps the login.

The caller's identity and memberships are left alone: the auth service's
``afterDelete`` strips and anonymizes them once the login is gone. Each
workspace commits on its own, because ending its subscription is a
billing-provider call no rollback can undo; if one fails, the ones before
it stay deleted, the error is returned, the auth service keeps the login,
and a retry carries on with what is left. Singleton by nature: it acts on
the caller's own account only.

Passing the guard records a deletion attempt for this request (PlatDev
#4518), so a co-owner deleting concurrently no longer counts the caller as
an owner. Every error path below deletes only this request's own attempt
row before answering, never the caller's other attempts; the success answer
keeps it, because the auth service deletes the login after it. The attempt
id is returned in the ``Botyard-Account-Deletion-Attempt`` header so the
auth service logs the same id (operator runbook).

## Responses

| Status | Description | Body |
| --- | --- | --- |
| `204` | Successful Response |  |
| `default` | RFC 9457 Problem Details error response | ProblemDetails |

Full schemas: operation `delete_current_user_v1_users_me_delete` in the OpenAPI spec at https://api.botyard.io/openapi.json.
