---
title: "Let people delete their account themselves · Agent Wranglers"
url: https://agentwranglers.se/playbook/accounts/profile-and-account-lifecycle/account-deletion
updated: 2026-10-20
licence: "All rights reserved"
---

# Let people delete their account themselves

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Profile and account lifecycle](https://agentwranglers.se/playbook/accounts/profile-and-account-lifecycle)
- Rule: Put account deletion in settings, behind fresh proof of identity, and finish it within one month, as [data requests](https://agentwranglers.se/playbook/website/privacy/data-requests) sets. Say first what happens to the person's data and organisations.
- How: Show what deletion removes and what stays, such as invoices kept for tax law. A last owner of an organisation transfers or deletes it first, as [never leave an organisation without an owner](https://agentwranglers.se/playbook/accounts/organisations-and-teams/last-owner) says. Then end every session, stop subscriptions and mark the account for deletion. Allow 14 days in which signing in cancels it, so the deletion still ends inside the month. State the date in the confirmation email. Then run the delete function from the [data requests rule](https://agentwranglers.se/playbook/website/privacy/data-requests).
- Check: Delete a test account. Its sessions end at once and the email states the date. After the grace period, a search of every store finds no trace except records the law requires.

Example:

```js
const GRACE_DAYS = 14;

export async function requestAccountDeletion(db, user) {
  if (await db.memberships.isLastOwnerAnywhere(user.id)) throw new ConflictError('Transfer or delete your organisations first.');
  const deleteOn = addDays(new Date(), GRACE_DAYS);
  await db.tx(async tx => {
    await tx.users.scheduleDeletion(user.id, deleteOn);
    await tx.sessions.deleteAllFor(user.id);
  });
  await billing.cancelSubscriptions(user.id);
  await mailer.sendDeletionScheduled(user, deleteOn);
}
```

```python
GRACE_PERIOD = timedelta(days=14)

def request_account_deletion(db, user) -> None:
    if db.memberships.is_last_owner_anywhere(user.id):
        raise Conflict("Transfer or delete your organisations first.")
    delete_on = date.today() + GRACE_PERIOD
    with db.transaction():
        db.users.schedule_deletion(user.id, delete_on)
        db.sessions.delete_all_for(user.id)
    billing.cancel_subscriptions(user.id)
    mailer.send_deletion_scheduled(user, delete_on)
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers accounts playbook: https://agentwranglers.se/playbook/accounts/profile-and-account-lifecycle/account-deletion`.

- Previous: [Let people export their data themselves](https://agentwranglers.se/playbook/accounts/profile-and-account-lifecycle/self-service-export)
- Next: [Warn before closing inactive accounts](https://agentwranglers.se/playbook/accounts/profile-and-account-lifecycle/inactive-accounts)
- [Profile and account lifecycle](https://agentwranglers.se/playbook/accounts/profile-and-account-lifecycle)
