> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/membership/settings/account.md).

# Account

Change the email flow users follow to close (deactivate) their account.

**Where:** Membership → Settings → **Account** · `/projects/<project>/membership/settings#account`

## Before you start

* The Email module is on, with a deactivation template (turning Email on adds *User deactivation*).
* You need the `membership:manage` permission.

## Steps

1. Open **Settings → Account**. The block **Deactivation via Email** holds the flow a user follows to close their account.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-5054f3cecc929c15ed37e893494604c4f3d16f86%2Fsettings-account-1.png?alt=media" alt="Account tab: Deactivation via Email with Enabled, User deactivation email template, Deactivation token expiration, Deactivation callback URL"><figcaption><p>The Account tab.</p></figcaption></figure>
2. Turn on **Enabled**, then press **Change** next to each row and **Submit**:

   | Setting                                    | What it does                             | Example                                  |
   | ------------------------------------------ | ---------------------------------------- | ---------------------------------------- |
   | User deactivation email template           | The email that asks the user to confirm. | `User deactivation`                      |
   | Deactivation token expiration (in minutes) | How long the confirmation link works.    | `1440`                                   |
   | Deactivation callback URL                  | Where the user lands after confirming.   | `https://app.example.com/account-closed` |

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-9838aca3b5a68823f066fff1fa3d57c33ef5702c%2Fsettings-account-2.png?alt=media" alt="Dialog User deactivation email template with the list showing User deactivation, Cancel and Submit"><figcaption><p>Choosing the template.</p></figcaption></figure>

## Result

With the flow on, a deactivation request sends the template; the user confirms through its link before it expires.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-e250c6033d2da052991aaef5480a54421396576e%2Fsettings-account-3.png?alt=media" alt="Account tab after a reload: Enabled on, template User deactivation, expiration 1440, callback URL a dash"><figcaption><p>After a reload.</p></figcaption></figure>

{% hint style="warning" %}
The **Deactivation callback URL** is not kept today: after a reload it shows `-`.
{% endhint %}

## Change or remove it later

* Turn **Enabled** off to stop the flow; the values stay.

## Do it from code

```ts
const { result } = await norbix.hub.membership.getAuthorizationSettings();
console.log(result.emailPreferences.deactivationViaEmail); // { sendEmail: true, template: { id: 'tmpl_…' } }
```

```sh
norbix hub membership authorization settings get
```

The client setup is on the [Membership page](/codemash/cloud/membership.md#use-it-from-code). API: [Get Authorization Settings](/codemash/api-reference/membership/settings/get-authorization-settings.md) · [Update Authorization Settings](/codemash/api-reference/membership/settings/update-authorization-settings.md)
