# Remove an enrolled WebAuthn security key

Deletes an enrolled WebAuthn security key from a mailbox. The mailbox's own bearer must re-prove the current password (removing the second factor is how a stolen session would downgrade the account); an account admin need not, because they cannot know it and removing a lost key is their remedy.

## `DELETE /api/v1/identities/{identityId}/webauthn/credentials/{webauthnId}`

### Path parameters

- `identityId` (string, required) — Mailbox identity ULID
- `webauthnId` (string, required) — WebAuthn key ULID identifier

### Request body (optional)

`application/json`

- `currentPassword` (string, 1–1024 chars) — The mailbox's current password. Required for the mailbox's own bearer, ignored for an account admin

### Responses

**200** — Security key removed successfully

**400** — password_required, for the mailbox's own bearer

`application/json` → ErrorOrValidation

**401** — unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a `WWW-Authenticate: Bearer` challenge

`application/json` → ErrorBody

**403** — invalid_password

`application/json` → ErrorBody

**404** — Mailbox or key not found

`application/json` → ErrorBody

**409** — no_password_credential: the mailbox's own bearer has no password to re-prove

`application/json` → ErrorBody

**413** — too_large: JSON request body exceeds 1 MiB or 500,000 values (object keys included), checked before parsing

`application/json` → ErrorBody

**429** — rate_limited: too many password re-proofs for this mailbox (every guess spends budget, right or wrong)

`application/json` → ErrorBody

**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)

`application/json` → ErrorBody

### Example request

```bash
curl -X DELETE 'https://api.open.email/api/v1/identities/{identityId}/webauthn/credentials/{webauthnId}' \
  -H 'Authorization: Bearer oek_…' \
  -H 'Content-Type: application/json' \
  -d '{}'
```

## TypeScript SDK

[`openemail.securityKeys.remove`](/docs/sdks/typescript/security-keys/remove)

```ts
await openemail.securityKeys.remove(identityId, webauthnId, {})
```
