# Delete account

`POST /api/account/delete`

Disables sign-in and inbound mail, cancels an active subscription, schedules removal of retained message content, and deletes account and authentication records. This operation cannot be undone. The request must come from the application origin and include the exact confirmation text.

Send API requests to your Wildmail application origin. The documentation host does not serve API requests.

## Authentication

- session: Send the credential in the cookie named `better-auth.session_token`. Browser session cookie used by the hosted app. It may use the __Secure- cookie prefix. Use the auth client to manage cookies.

## Parameters

### Origin

header parameter; required.

Must match the configured Wildmail application origin.

```json
{
  "name": "Origin",
  "in": "header",
  "required": true,
  "schema": {
    "type": "string",
    "format": "uri"
  },
  "description": "Must match the configured Wildmail application origin."
}
```

## Request body

Required.

Content type: `application/json`.

Schema:

```json
{
  "type": "object",
  "properties": {
    "confirmation": {
      "type": "string",
      "const": "DELETE"
    }
  },
  "required": [
    "confirmation"
  ],
  "additionalProperties": false
}
```

Example:

```json
{
  "confirmation": "DELETE"
}
```

## Responses

### 200

Deletion completed.

Content type: `application/json`.

Schema:

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "success"
  ]
}
```

### 400

The confirmation value is missing or invalid.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 401

A signed-in session is required.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 403

Cross-origin request refused.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 503

Deletion is still in progress. Retry the request or contact support.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

## Referenced schemas

References resolve against the [OpenAPI specification](/openapi.json).

### #/components/schemas/Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "limit": {
      "type": "integer"
    }
  },
  "required": [
    "error"
  ]
}
```
