# Deleting an account

## Summary

A person can delete their own account. Deletion is immediate and cannot be
undone. There is no waiting period and no way to restore the account.

Deleting removes the person: their name and email address are erased, they are
signed out everywhere, they leave every organization, and their API keys and
connected apps stop working. It does not remove their work: the files and
versions they uploaded stay in their workspaces, credited to "Deleted user".

Two things are needed: the current password, and that no live organization
would be left without an owner. The email address need not be verified.

An account that never verified its email and still holds nothing 30 days after
sign-up is removed without anyone asking
([Unverified accounts are removed after 30 days](#unverified-accounts-are-removed-after-30-days)).

## Who can do what

| Action | Signed-out visitor | Signed in, email unverified | Signed in, email verified | API key or connected app |
| --- | --- | --- | --- | --- |
| Delete the own account | No | Yes, on the same terms as a verified account | Yes, with the current password, unless the person is the only owner of a live organization | No: `FORBIDDEN`, reason `SESSION_REQUIRED` |
| Delete someone else's account | No | No | No | No |

What the person is in their organizations decides whether deletion goes
through:

| Standing | Can they delete their account? |
| --- | --- |
| The only owner of a live organization | No: `SOLE_OWNER`, until another member is an owner or the organization is deleted |
| One of several owners | Yes. The organization keeps its other owners |
| Admin or member | Yes |
| Member of no organization | Yes |
| The only owner of an organization that is itself deleted and waiting out its 30 days | Yes, on purpose. The organization is purged when its 30 days end and nobody can restore it. See the edge cases |

Owners and admins can remove a member from their organization. They cannot
delete that person's account. Only the person can.

Deleting an account is not an MCP tool. No credential scope grants it.

## How it works

### What is needed

- The person must be signed in. Deletion is done in a browser session.
- The account's email need not be verified.
- The person must enter their current password. A wrong one gets
  `422 VALIDATION_FAILED` on `currentPassword` and deletes nothing.
- The person must not be the only owner of a live organization. Otherwise
  deletion is refused with `409 SOLE_OWNER`, "Transfer ownership or delete the
  organization first", and `details.organizationIDs` lists every such
  organization.
- These are checked in this order: session, password, sole ownership. So a
  sole owner who mistypes the password is told about the password first.
- A refusal changes nothing. The person stays signed in.

### The last-owner rule

- Every live organization keeps at least one owner. An organization without an
  owner could never be deleted, restored or handed over.
- "Only owner" means the only member with the role owner in the organization.
  Other admins and members do not count.
- A sole owner has two ways forward:
  - make another member an owner, then delete the account
    ([Members and roles](../organizations/members-and-roles.md));
  - delete the organization, then delete the account
    ([Deleting and restoring](../organizations/delete-and-restore.md)). This
    is allowed on purpose. The deleted organization then has no owner: it is
    purged when its 30 days end, and nobody can restore it.
- When two owners of one organization delete their accounts at the same
  moment, one succeeds and the other is refused with `SOLE_OWNER`. The
  organization is never left without an owner.

### What deletion does

All of this happens at once, as one change:

- **Identity.** The email address and the name are erased from the account.
  The name becomes "Deleted user". The password is removed.
- **Sign-in.** The old address and password no longer sign in. They get
  `INVALID_CREDENTIALS`, like an address that never had an account.
- **Sessions.** Every session ends, on every device. The browser that deleted
  the account is signed out as part of the answer. Other browsers are signed
  out at their next request.
- **Organizations and workspaces.** The person is removed from every
  organization and every workspace. They no longer appear in member lists.
- **Invitations they sent.** Pending invitations sent by the person are
  withdrawn. Their links stop working.
- **Emailed links.** An outstanding verification link, password reset link or
  email change confirmation link of the account becomes invalid. A pending
  email change is dropped.
- **API keys and connected apps.** Every one of the person's API keys and
  connected apps is revoked, in every organization. Requests with them answer
  `401 UNAUTHENTICATED`, reason `INVALID_TOKEN`.
- **The email address is free.** Anyone, including the same person, can create
  a new account with it straight away.
- No email is sent about the deletion.

### What deletion keeps

- **Files and versions.** Everything the person uploaded stays where it is, in
  its workspace or organization folder. Nothing moves to another person.
- **Credit.** Wherever the person was named as the author of a version or as
  the last person to change a file, the name now reads "Deleted user".
- **Organizations.** Organizations the person belonged to carry on. An
  organization the person co-owned keeps its other owners.
- **Other people's invitations to the address.** A pending invitation that was
  sent to the deleted account's address is not withdrawn. It stays valid for
  that address until it expires or is revoked.
- **Feedback.** Reports the person sent to the Talewright team stay, with
  their message, technical context and images. They no longer name the
  person: the link between a report and the account is cut. See
  [Giving feedback](feedback.md#when-the-sender-deletes-their-account).

### No grace period, no restore

- Deletion takes effect the moment it is confirmed.
- Nobody can restore a deleted account: not the person, not an owner, not
  through the API.
- This differs from organizations and workspaces, which stay restorable for 30
  days after they are deleted.
- An account cannot be deactivated or paused. Deleting it is the only way to
  close it.
- Two accounts cannot be merged into one.
- Signing up again with the same address creates a new account. It has a new
  identity. It belongs to no organization, has no API keys, and is not linked
  to the files the deleted account uploaded. Those stay credited to "Deleted
  user".

### An unverified account

- An unverified account deletes itself like any other: with its current
  password, and not while it is the only owner of a live organization.
- Why: nobody else can delete an account, and an address that was mistyped
  at sign-up can never open a verification link.
- Deleting a workspace or an organization still needs a verified email. So an
  unverified person who is the only owner of an organization is refused with
  `SOLE_OWNER` and has two ways forward:
  - verify the email, delete the organization, then delete the account. The
    link comes from the verification email or from "Resend verification
    email" ([Sign-up and email verification](sign-up.md#asking-for-a-new-link)).
    If the address cannot receive email, the person changes the email address
    and confirms the new one, which verifies the account
    ([Password and email address](password-and-email.md#changing-the-email-address));
  - make another member an owner, then delete the account.

### Unverified accounts are removed after 30 days

- An account whose email was never verified is removed 30 days after sign-up,
  if it is still empty then. Nobody has to ask.
- Empty means the account holds none of these:
  - a file, live or in the trash, in an organization it belongs to;
  - a folder, live or in the trash;
  - an upload in progress;
  - another member in one of its organizations;
  - a pending invitation sent from one of its organizations;
  - an API key or a connected app, also a revoked or expired one that is
    still listed;
  - a membership in someone else's organization;
  - a pending email change.
- An unverified account that holds any of these is never removed this way,
  however old it is. It stays until its owner verifies or deletes it.
- These do not count as holding something: an organization and its workspaces
  with nothing in them, the statuses and fields of its organization folder and
  workspaces, an export of an empty organization, and feedback the account
  sent.
- The check runs about once an hour and looks at the account as it is then.
  An account that was emptied later (its only file purged from the trash, its
  revoked key dropped from the list after 30 days) is removed at the next
  check.
- Verifying the email at any time before the removal keeps the account for
  good. The 30 days count from sign-up, not from the last sign-in.
- Removal does what deleting the account does: the name and email are erased,
  every session ends and the address is free for a new account at once.
- An empty organization the account alone owned is deleted with it, the way
  its owner would have had to delete it first. It is purged after the usual
  30 days. Nobody can restore it, since it has no member left.
- No email announces the removal, before or after.

### The limit on wrong passwords

- The current password is checked at most 10 times per account in 15 minutes.
  This count is shared with changing the password and changing the email
  address.
- Beyond it, deletion is refused with `429 RATE_LIMITED` until the 15 minutes
  end, even with the correct password.
- A correct password clears the count.

## In the app

Words in braces, such as {address}, stand for the real value.

- Open Settings, then "Security", then "Delete account"
  (`/settings/security/delete-account`).
- The section "Delete account" says: "Deleting your account signs you out
  everywhere and removes your name and email. Files you uploaded stay with
  their workspaces, credited to "Deleted user". This cannot be undone."
- The button "Delete account" opens the dialog "Delete your account?" with
  "You are signed out everywhere and your name and email are removed. This
  cannot be undone."
- When the browser tab holds unsaved changes, the dialog adds "One draft has
  changes that are not saved. Deleting your account removes them from this
  browser." (or "3 drafts have changes that are not saved." with the count).
- The dialog has the field "Current password" and the buttons "Cancel" and
  "Delete account". The field has a button at its end that shows what was
  typed, and hides it again.
- "Cancel" closes the dialog. Nothing is sent.
- An unverified account sees the same section and dialog.
- What the dialog shows when deletion is refused:
  - wrong password: "Your current password is incorrect." under the field.
    The field keeps what was typed and takes focus;
  - only owner: an alert "Another owner is needed" with "You are the only
    owner of Acme. Make another member an owner, or delete the organization,
    before deleting your account." Several organizations are named as "Acme
    and Globex" or "Acme, Globex and Initech". For an unverified account the
    alert adds "Deleting an organization needs a verified email.";
  - too many wrong passwords: "Too many attempts. Try again in 4 minutes."
    (the time varies);
  - anything else: "Something went wrong. Try again."
- The password and every refusal stay in the dialog, so the person can correct
  and try again.
- The dialog sends one request at a time. A double click does not send two.
- After deletion the sign-in page opens with "Account deleted" and "Your
  sessions have ended."
- The browser tab then holds nothing of the account: no open tabs and no
  unsaved drafts. The browser no longer remembers the last used workspace.

## For agents

Deleting an account is for a person in a browser. It is not an MCP tool.

| Operation | Capability ID | Access | MCP |
| --- | --- | --- | --- |
| `DELETE /v1/me` | `account.delete` | session only | none |

- Body: `currentPassword`.
- `204`: deleted and signed out. The response clears the session cookie. No
  body.
- `401 UNAUTHENTICATED`: no live session.
- An unverified account gets the same answers as a verified one. This
  operation never answers `EMAIL_NOT_VERIFIED`.
- `422 VALIDATION_FAILED` with `details.field` `currentPassword`: the password
  is wrong.
- `429 RATE_LIMITED`: too many wrong passwords.
- `409 SOLE_OWNER` with `details.organizationIDs`: the organizations that
  would be left without an owner.
- Called with a valid API key: `403 FORBIDDEN`, `details.reason`
  `SESSION_REQUIRED`. A bearer token that does not authenticate answers
  `401 UNAUTHENTICATED`, reason `INVALID_TOKEN`.
- A request with a session cookie must send an `Origin` header equal to the
  app's origin.

**What an agent sees when its member deletes their account.** The agent's API
key or connected app is revoked with the account. Its next request answers
`401 UNAUTHENTICATED`, reason `INVALID_TOKEN`. Nothing brings it back. Files
the agent uploaded for that member stay, credited to "Deleted user".

Worked example:

```sh
curl -i -X DELETE https://app.usetalewright.com/v1/me \
  -b cookies.txt \
  -H 'Origin: https://app.usetalewright.com' \
  -H 'Content-Type: application/json' \
  -d '{"currentPassword":"correct horse battery"}'
# 204 No Content
# set-cookie: __Host-session=; Max-Age=0; Path=/; HttpOnly; SameSite=Lax; Secure
```

Refused for the only owner of an organization:

```json
{
  "error": {
    "code": "SOLE_OWNER",
    "message": "Transfer ownership or delete the organization first",
    "details": {
      "organizationIDs": ["0192a6c1-5a0e-7c33-b0de-2f6f0d1c9a10"]
    }
  },
  "requestID": "01928f3e-7c1a-7d2b-9a41-3f0c2d9e8b17"
}
```

## Edge cases

Before deletion

1. **The password is wrong.** Reported in the dialog. Nothing is deleted and
   the person stays signed in. Why: a session alone is not enough to delete
   an account.
2. **The password was wrong 10 times in 15 minutes.** Further attempts are
   refused, even with the correct password, until the window ends. Wrong
   passwords entered while changing the password or the email count toward the
   same limit.
3. **The account is unverified.** It is deleted like any other, with the
   current password.
4. **The account is unverified and is the only owner of an organization.**
   Refused with `SOLE_OWNER`. Deleting the organization needs a verified
   email, so the person verifies first, or makes another member an owner. If
   the address cannot receive email, the person changes the email address to
   one that can and confirms it, which verifies the account.
5. **The person is the only owner of one organization.** Refused. The dialog
   names the organization.
6. **The person is the only owner of several organizations.** Refused. All of
   them are named, and `details.organizationIDs` lists all of them.
7. **The person is the only owner and also mistypes the password.** The
   password is reported. The ownership refusal appears once the password is
   right.
8. **The organization has other members, but none is an owner.** Still
   refused. An admin is not an owner.
9. **The person is one of two owners.** Deletion goes through. The other owner
   keeps the organization.
10. **Both owners delete their accounts at the same moment.** One succeeds.
    The other is refused with `SOLE_OWNER` and is now the only owner.
11. **The person is the only owner of an organization that was already
    deleted and is waiting out its 30 days.** It does not block deletion. The
    person's membership is removed with the account, so afterwards that
    organization has no owner and nobody can restore it. It is removed for
    good when its 30 days end. This is allowed on purpose: a sole owner who
    wants to leave deletes the organization, then the account.
12. **A deleted organization has a second owner.** That owner can still
    restore it within its 30 days.
13. **The session expired while the dialog was open.** The request answers
    `UNAUTHENTICATED` and the app opens the sign-in page. Nothing is deleted.
14. **"Cancel", or closing the dialog.** Nothing is sent.

What deletion touches

15. **The person is signed in on other devices.** Those browsers are signed
    out at their next request.
16. **The person has unsaved drafts in the browser.** They are discarded with
    the account. The dialog says so beforehand, as "Sign out" does.
17. **Scripts, agents or connected apps use the person's credentials.** They
    stop working at once.
18. **The person sent invitations that are still pending.** They are
    withdrawn. The invited people see "Link expired or invalid" and need a new
    invitation from someone else.
19. **Someone had invited the person, and the invitation is still pending.** It
    stays. A new account created with the same address can accept it until it
    expires.
20. **A password reset link or an email change was outstanding.** The link is
    dead.
21. **The person uploaded files.** They stay in place. Version history and
    "last changed by" read "Deleted user".
22. **Two deleted people worked on the same file.** Both read "Deleted user".
    Their names cannot be told apart any more.
23. **The person was an admin who managed members and statuses.** What they
    set up stays as it is. Only their own membership is gone.

Afterwards

24. **The person tries to sign in again.** `INVALID_CREDENTIALS`.
25. **The person asks for a password reset for the old address.** The page
    shows "Check your email" as always. Nothing is sent.
26. **The person signs up again with the same address.** A new account is
    created and a verification email is sent, exactly as for an address that
    never had an account. Nothing of the old account is attached to it.
27. **The person wants back into their old organization.** An owner or admin
    invites the new account. It joins as a new member. The old uploads stay
    credited to "Deleted user".
28. **The person asks for the deletion to be undone.** It cannot be.
29. **A request to the API uses an API key to delete the account.** Refused
    with `SESSION_REQUIRED`. Nothing is deleted.

## Errors

| Code | HTTP | Meaning here | What to do |
| --- | --- | --- | --- |
| `UNAUTHENTICATED` | 401 | "Authentication required". No live session. | Sign in again. |
| `VALIDATION_FAILED` | 422 | `details.field` `currentPassword`: "current password is incorrect", or "currentPassword must be 1 to 1024 bytes" for an empty or oversized value. | Enter the current password. If it is lost, reset it first. |
| `VALIDATION_FAILED` | 422 | The body is not valid JSON or lacks `currentPassword`. `details` is `null`. | Fix the request. |
| `RATE_LIMITED` | 429 | "Too many attempts; try again later". `details.retryAfterSeconds` and `Retry-After` give the wait. | Wait that long. |
| `SOLE_OWNER` | 409 | "Transfer ownership or delete the organization first". `details.organizationIDs` lists the live organizations the person alone owns. | Make another member an owner of each, or delete each organization, then delete the account. |
| `FORBIDDEN` | 403 | Reason `SESSION_REQUIRED`: "This operation needs a person signed in with a browser". | Delete the account in the app. |
| `FORBIDDEN` | 403 | "Forbidden". The `Origin` header is not the app's origin, or a session cookie came without one. | Send the request from the app, or with the app's origin. |

## Limits

| What | Limit |
| --- | --- |
| Waiting period before deletion takes effect | None |
| Time in which a deleted account can be restored | None |
| Current-password checks per account (account deletion, password change and email change together) | 10 in 15 minutes |
| Time until the address can be used for a new account | None; it is free at once |
| Time a deleted organization stays restorable, for comparison | 30 days |
| Time after sign-up until an unverified, empty account is removed | 30 days, checked about once an hour |

## Questions and answers

**How do I delete my account?**
Settings, Security, "Delete account". Enter your current password in the
dialog and choose "Delete account".

**Can I get my account back?**
No. Deletion is immediate and final.

**Is there a waiting period?**
No.

**What happens to the files I uploaded?**
They stay in their workspaces. Their history shows "Deleted user" instead of
your name.

**How do I remove my files as well?**
Deleting the account does not remove files. They are removed like any other
file, by someone who may do so in the workspace
([Trash and restore](../files/trash.md)).

**What personal data is erased?**
Your name, your email address and your password. The account that remains is
an anonymous marker, so that history still has an author.

**Why can I not delete my account? It says "Another owner is needed".**
You are the only owner of an organization. Make another member an owner, or
delete the organization, then try again.

**Can I delete my account before verifying my email?**
Yes, with your current password. If you are the only owner of an organization
you are refused until the organization has another owner or is deleted, and
deleting an organization needs a verified email.

**I signed up and never verified. Is my account deleted for me?**
After 30 days, if it is still empty: no files or folders, no upload in
progress, no other members or pending invitations, no API keys or connected
apps, no pending email change. An account that holds any of these stays.

**I forgot my password. Can I still delete my account?**
Reset the password first with "Forgot password?" on the sign-in page, sign in,
then delete.

**Does deleting my account delete my organization?**
No. If you are its only owner, deletion is refused until you hand it over or
delete it yourself. Otherwise the organization carries on without you.

**I deleted my organization and then my account. Can the organization still be
restored?**
Only by another owner, within 30 days. If you were its only owner, nobody can
restore it, and it is purged when its 30 days end. Deleting both in that order
is allowed on purpose.

**What happens to my API keys and connected apps?**
They are revoked at once, in every organization.

**What happens to invitations I sent?**
Pending ones are withdrawn. Invitations that were already accepted are not
affected: those people stay members.

**Will my teammates be told?**
No email is sent. You disappear from member lists and your name on versions
becomes "Deleted user".

**Can I sign up again with the same email address?**
Yes, at once. It is a new account with no connection to the old one.

**Can an owner or admin delete my account?**
No. They can remove you from their organization. Only you can delete your
account.

**Can an agent or an API key delete my account?**
No. The operation needs a person signed in with a browser and the current
password.

**I am signed in on my phone too. What happens there?**
It is signed out the next time the app there makes a request.

**How do I leave an organization without deleting my account?**
Leave it from the organization's settings
([Members and roles](../organizations/members-and-roles.md)).

**Can I export my data before I delete my account?**
Owners and admins can export an organization
([Export](../organizations/export.md)). For single files see
[Downloading](../files/downloading.md).

## Related pages

- [Sign-up and email verification](sign-up.md)
- [Sign-in and sessions](sign-in-and-sessions.md)
- [Password and email address](password-and-email.md)
- [Members and roles](../organizations/members-and-roles.md)
- [Deleting and restoring](../organizations/delete-and-restore.md)
- [Credentials and scopes](../agents/credentials.md)
- [Errors](../reference/errors.md)

