# recovery.removeAddress

Remove the mailbox's recovery address.

Removes the verified address and any pending one, and notifies both the mailbox and the address being removed. The mailbox's own bearer must re-prove the current password; an account admin need not, because they cannot know it. Recovery codes are untouched.

```ts
openemail.recovery.removeAddress(
  identityId: string,
  body?: RecoveryRemoveAddressBody,
  options?: CallOptions,
): ApiPromise<RecoveryAddressDeleted>
```

It calls `DELETE /identities/{identityId}/recovery`: [Remove the mailbox's recovery address](/docs/api/credentials/delete_RecoveryAddressDelete) in the API reference.

## Example

```ts
const recoveryAddressDeleted = await openemail.recovery.removeAddress(identityId, {})
```

## Arguments

| Argument | Type | Description |
| --- | --- | --- |
| `identityId` | `string` | Mailbox identity ULID. The path's `{identityId}`. |
| `body` | [`RecoveryRemoveAddressBody`](#recoveryremoveaddressbody) | Optional. The request's body. |

## Options

It takes no options of its own. Every call also takes `signal`, `timeout`, `retry` and `headers`, which say how that one call is sent ([call options](/docs/sdks/typescript/calling-methods#call-options)).

## Answer

Awaited, it is the API's JSON, [`RecoveryAddressDeleted`](/docs/sdks/typescript/types/recovery-address-deleted). It is an [`ApiPromise`](/docs/sdks/typescript/responses): `.withResponse()` gives the same with the `Response` it came in, for its headers.

## Errors

| Status | What it means |
| --- | --- |
| `400` | password_required, for the mailbox's own bearer |
| `401` | unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a `WWW-Authenticate: Bearer` challenge |
| `403` | invalid_password |
| `404` | Mailbox not found or not accessible to this principal |
| `409` | no_password_credential: the mailbox's own bearer has no password to re-prove |
| `413` | too_large: JSON request body exceeds 1 MiB or 500,000 values (object keys included), checked before parsing |
| `429` | rate_limited: too many password re-proofs for this mailbox (every guess spends budget, right or wrong) |
| `503` | temporary_failure: the platform's storage could not answer just now; retry after the Retry-After window. Any operation can answer this. A write that got it may have been applied, so retry it with the same idempotency key where it takes one, or read the state back first (see Transient failures in the API description) |

A failed call rejects with a [`RequestError`](/docs/sdks/typescript/errors): its `status`, and its `code`, the API's `error`. Decide on the code: one status covers several.

## Types

### RecoveryRemoveAddressBody

```ts
/** The body of `recovery.removeAddress`. */
type RecoveryRemoveAddressBody = {
  /** The mailbox's current password. Required for the mailbox's own bearer, ignored for an account admin */
  currentPassword?: string
}
```

It names these types of the API, each on a page of its own: [`RecoveryAddressDeleted`](/docs/sdks/typescript/types/recovery-address-deleted).
