# Deactivating a Matrix Account

<!---
Actions needed:
- [ ] 

# Deactivating a Matrix Account
--->

<!---<p class="callout info">Remember to check our <a href="https://ems-docs.element.io/books/kieranml-test-book/page/have-you-tried-httpselementiohelp">Looking for help?</a> page for answers to Frequently Asked Questions and our User Guide!</p>--->

<p class="callout warning"><b>Disclaimer:</b> This guide refers to using the Element Matrix clients, <a href="https://app.element.io/" target="_blank" rel="noopener noreferrer">Element Web</a> or <a href="https://element.io/download" target="_blank" rel="noopener noreferrer">Element Desktop</a> apps</p>

### Deactivating your Matrix Account

If you wish to deactivate your account, you can do so by following the below steps:

- Log in to your Matrix Client
- Click on your Avatar / Username in the top left corner
- Open `Settings`
- From the bottom of the `General` tab, click `Deactivate`
- Check any additional options, if applicable, then enter your password or confirm via SSO to deactivate your account

[![deactivate_account_warning_and_confirmation_prompt](https://ems-docs.element.io/uploads/images/gallery/2023-03/scaled-1680-/image-1679492386786.png)](https://ems-docs.element.io/uploads/images/gallery/2023-03/image-1679492386786.png)

Please note once the account has been deactivated, it is impossible to reactivate it again or reuse the username. Your user is stored indefinitely to avoid account recycling, as such you may also wish to remove any Third-Party ID's from your account **before** deactivation, as this may cause issues if you ever attempt to create a new account.

#### Erasing your Matrix Account

You can also GDPR erase your account, this means messages sent by the user will still be visible by anyone that was in the room when these messages were sent, but hidden from users joining the room afterwards. You can do this by checking the `Hide my messages from new joiners` checkbox on the `Deactivate Account` confirmation prompt.

### Deactivating a Matrix Account on your Homeserver

If you're an EMS customer, you can create your users via the <a href="https://ems.element.io/user/hosting#/admin" target="_blank" rel="noopener noreferrer">Server Admin</a> tab of the <a href="https://ems.element.io/user/hosting" target="_blank" rel="noopener noreferrer">EMS Control Panel</a>.
<!---Check out the [Server Admin]() section of the [EMS Control Panel]() doc for more guidance.--->

Alternatively you can make use of the <a href="https://matrix-org.github.io/synapse/latest/usage/administration/admin_api/" target="_blank" rel="noopener noreferrer">Synapse Admin API</a> to deactivate a Matrix Account on a homeserver you hold an Admin account on. To do so, you will need to use <a href="https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#deactivate-account" target="_blank" rel="noopener noreferrer">Deactivate Account</a> from the <a href="https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#user-admin-api" target="_blank" rel="noopener noreferrer">User Admin API</a>.
<!---For more information on using the <a href="https://matrix-org.github.io/synapse/latest/usage/administration/admin_api/" target="_blank" rel="noopener noreferrer">Synapse Admin API</a> check our [Getting Started using the Admin API]() documentation.--->

```
https://HOMESERVER_URL/_synapse/admin/v1/deactivate/FULL_USERNAME
```

```json
{
    "erase": true
}
```