# Get what deleting needs

`GET /api/v1/me/deletion`

What deleting the signed-in account would do, what blocks it and what proof it takes.

Sign-in: a dashboard session only. API tokens and OAuth sign-ins get `403 token.not_allowed`.

Section: Sign-in and account. Operation id in openapi.json: `get_account_deletion`.

## Responses

Errors are `application/problem+json` (`Problem`); branch on `type`.

### 200

What deleting would do.

`application/json`: AccountDeletionView

| Field | Type | Required | Description |
|---|---|---|---|
| `allowed` | boolean | yes | Nothing blocks the deletion: no shared workspace is owned, none of the person's workspaces is blocked and the account is not the installation owner. |
| `deletedWorkspaces` | array of AccountDeletionWorkspace | yes | Workspaces where the person is the only member: stopped and hidden with the account, their data kept. |
| `hasPassword` | boolean | yes | The account has a password: `DELETE /me` takes it as proof. |
| `installationOwner` | boolean | yes | The installation owner's account cannot be deleted here. |
| `leftWorkspaces` | array of AccountDeletionWorkspace | yes | Workspaces the person leaves; what is in them stays. |
| `needsCode` | boolean | yes | Two-factor sign-in is on: `DELETE /me` needs a current code. |
| `reauthProviders` | array of string | yes | Linked providers this installation offers: a re-authentication at one of them (intent `reauth`) within the last 5 minutes stands in for the password. |
| `reauthenticated` | boolean | yes | A provider re-authentication of this session is recent enough right now. |
| `sharedWorkspaces` | array of AccountDeletionWorkspace | yes | Owned workspaces with other members: ownership must go to someone else first. |

### 400

Bad Request.

- `auth.credentials_conflict`: the request carries both a session cookie and a token

### 401

Unauthorized.

- `auth.unauthenticated`, `auth.session_expired`: no session, or it ended
- `token.invalid`: the token is malformed, unknown, revoked or expired, or its creator left the workspace

### 403

Forbidden.

- `auth.forbidden`: your role is too low for this
- `token.not_allowed`: this operation needs a signed-in session; tokens cannot call it

Schemas named above are listed with their fields in [the schema list](https://docs.monitorly.cloud/api/reference/schemas.md).
