Skip to Content

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.

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

It calls DELETE /identities/{identityId}/recovery: Remove the mailbox's recovery address in the API reference.

Example

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

Arguments

ArgumentTypeDescription
identityIdstringMailbox identity ULID. The path's {identityId}.
bodyRecoveryRemoveAddressBodyOptional. 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).

Answer

Awaited, it is the API's JSON, RecoveryAddressDeleted. It is an ApiPromise: .withResponse() gives the same with the Response it came in, for its headers.

Errors

StatusWhat it means
400password_required, for the mailbox's own bearer
401unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a WWW-Authenticate: Bearer challenge
403invalid_password
404Mailbox not found or not accessible to this principal
409no_password_credential: the mailbox's own bearer has no password to re-prove
413too_large: JSON request body exceeds 1 MiB or 500,000 values (object keys included), checked before parsing
429rate_limited: too many password re-proofs for this mailbox (every guess spends budget, right or wrong)
503temporary_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: its status, and its code, the API's error. Decide on the code: one status covers several.

Types

RecoveryRemoveAddressBody

/** 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.