# Account

Deactivate or delete your own account.

An SDK signs every request with your key: [Authentication](https://mailset.app/docs/authentication.md). To sign one yourself, see [Calling the API without an SDK](https://mailset.app/docs/authentication/http.md).

## account.deactivate

Deactivate your account: you can’t sign in, your mail stays.

`POST /v1/account.deactivate`

Any signed-in person, with an API token. It can stop for a passkey approval.

### Parameters

It takes no input: send an empty object.

Beside `input`:

- `approval` (string, optional): An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve.

### Returns

`data` is an object with:

- `deactivated` (boolean)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.account.deactivate();
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.account.deactivate()
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	answer, err := client.Account.Deactivate(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.account.deactivate
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->account->deactivate();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.AccountDeactivateResult;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

AccountDeactivateResult answer =
        mailset.account().deactivate();
System.out.println(answer);
```

Rust:

```rust
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.account().deactivate().await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/account.deactivate \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset account deactivate
```

### Response

```json
{
  "ok": true,
  "data": {
    "deactivated": true
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/account#account-deactivate)

## account.deletionPlan

Show what deleting your account would remove, and what stays.

`POST /v1/account.deletionPlan`

Any signed-in person, with an API token.

### Parameters

It takes no input: send an empty object.

### Returns

`data` is an object with:

- `scheduledFor` (nullable number): Null: nothing is scheduled.
- `graceDays` (number)
- `blockers` (array of strings): Each one has to be sorted out first.
- `removes` (object)
  - `mailboxes` (array of objects)
    - `address` (string)
    - `messages` (number)
    - `bytes` (number)
  - `orgs` (array of strings)
- `handsOver` (array of objects): Mailboxes only you can open, in orgs that carry on: they go to an owner first.
  - `address` (string)
  - `to` (string)
- `stays` (object)
  - `sharedMailboxes` (array of strings): Shared with someone else, so they carry on without you.
  - `orgs` (array of strings)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.account.deletionPlan();
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.account.deletion_plan()
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	answer, err := client.Account.DeletionPlan(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.account.deletion_plan
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->account->deletionPlan();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.DeletionPlan;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

DeletionPlan answer = mailset.account().deletionPlan();
System.out.println(answer);
```

Rust:

```rust
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.account().deletion_plan().await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/account.deletionPlan \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset account deletionPlan
```

### Response

```json
{
  "ok": true,
  "data": {
    "scheduledFor": 1,
    "graceDays": 1,
    "blockers": [
      "text"
    ],
    "removes": {
      "mailboxes": [
        {
          "address": "hello@example.com",
          "messages": 1,
          "bytes": 20480
        }
      ],
      "orgs": [
        "text"
      ]
    },
    "handsOver": [
      {
        "address": "hello@example.com",
        "to": "ana@example.com"
      }
    ],
    "stays": {
      "sharedMailboxes": [
        "text"
      ],
      "orgs": [
        "text"
      ]
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/account#account-deletionPlan)

## account.delete

Delete your account, after a grace period you can cancel in.

`POST /v1/account.delete`

Any signed-in person, with an API token. It can stop for a passkey approval.

### Parameters

It takes no input: send an empty object.

Beside `input`:

- `approval` (string, optional): An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve.

### Returns

`data` is an object with:

- `scheduledFor` (nullable number): Null: nothing is scheduled.
- `graceDays` (number)
- `blockers` (array of strings): Each one has to be sorted out first.
- `removes` (object)
  - `mailboxes` (array of objects)
    - `address` (string)
    - `messages` (number)
    - `bytes` (number)
  - `orgs` (array of strings)
- `handsOver` (array of objects): Mailboxes only you can open, in orgs that carry on: they go to an owner first.
  - `address` (string)
  - `to` (string)
- `stays` (object)
  - `sharedMailboxes` (array of strings): Shared with someone else, so they carry on without you.
  - `orgs` (array of strings)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.account.delete();
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.account.delete()
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	answer, err := client.Account.Delete(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.account.delete
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->account->delete();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.DeletionPlan;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

DeletionPlan answer = mailset.account().delete();
System.out.println(answer);
```

Rust:

```rust
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.account().delete().await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/account.delete \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset account delete
```

### Response

```json
{
  "ok": true,
  "data": {
    "scheduledFor": 1,
    "graceDays": 1,
    "blockers": [
      "text"
    ],
    "removes": {
      "mailboxes": [
        {
          "address": "hello@example.com",
          "messages": 1,
          "bytes": 20480
        }
      ],
      "orgs": [
        "text"
      ]
    },
    "handsOver": [
      {
        "address": "hello@example.com",
        "to": "ana@example.com"
      }
    ],
    "stays": {
      "sharedMailboxes": [
        "text"
      ],
      "orgs": [
        "text"
      ]
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/account#account-delete)

## account.cancelDeletion

Stop your account from being deleted.

`POST /v1/account.cancelDeletion`

Any signed-in person, with an API token.

### Parameters

It takes no input: send an empty object.

### Returns

`data` is an object with:

- `scheduledFor` (nullable number): Null: nothing is scheduled.
- `graceDays` (number)
- `blockers` (array of strings): Each one has to be sorted out first.
- `removes` (object)
  - `mailboxes` (array of objects)
    - `address` (string)
    - `messages` (number)
    - `bytes` (number)
  - `orgs` (array of strings)
- `handsOver` (array of objects): Mailboxes only you can open, in orgs that carry on: they go to an owner first.
  - `address` (string)
  - `to` (string)
- `stays` (object)
  - `sharedMailboxes` (array of strings): Shared with someone else, so they carry on without you.
  - `orgs` (array of strings)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.account.cancelDeletion();
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.account.cancel_deletion()
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	answer, err := client.Account.CancelDeletion(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.account.cancel_deletion
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->account->cancelDeletion();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.DeletionPlan;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

DeletionPlan answer = mailset.account().cancelDeletion();
System.out.println(answer);
```

Rust:

```rust
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.account().cancel_deletion().await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/account.cancelDeletion \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset account cancelDeletion
```

### Response

```json
{
  "ok": true,
  "data": {
    "scheduledFor": 1,
    "graceDays": 1,
    "blockers": [
      "text"
    ],
    "removes": {
      "mailboxes": [
        {
          "address": "hello@example.com",
          "messages": 1,
          "bytes": 20480
        }
      ],
      "orgs": [
        "text"
      ]
    },
    "handsOver": [
      {
        "address": "hello@example.com",
        "to": "ana@example.com"
      }
    ],
    "stays": {
      "sharedMailboxes": [
        "text"
      ],
      "orgs": [
        "text"
      ]
    }
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/account#account-cancelDeletion)

---

© 2026 Intenseloop, Inc. Mailset’s site, docs and guides are copyrighted. You may read them and use their code to build with Mailset. Don’t republish them or use them to build a copy of Mailset. Terms: https://mailset.app/terms#content