# Change mailbox login password

Updates the login password for a mailbox by verifying the existing password.

## `PUT /api/v1/identities/{identityId}/password`

### Path parameters

- `identityId` (string, required) — Mailbox identity ULID

### Request body (required)

`application/json`

- `currentPassword` (string, required, 1–1024 chars)
- `newPassword` (string, required, 8–1024 chars)

### Responses

**200** — Password updated successfully

`application/json` → PasswordChanged

- `changed` (true, required) — Always true when password rotation succeeds
- `credentialId` (string, required) — The credential ID whose password was rotated

**400** — validation_failed — new password too short

`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_current_password

`application/json` → ErrorBody

**404** — Mailbox not found or not accessible to this principal

`application/json` → ErrorBody

**409** — no_password_credential — mailbox has no password credential to change

`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 change attempts

`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 PUT 'https://api.open.email/api/v1/identities/{identityId}/password' \
  -H 'Authorization: Bearer oek_…' \
  -H 'Content-Type: application/json' \
  -d '{
    "currentPassword": "string",
    "newPassword": "string"
  }'
```

## TypeScript SDK

[`openemail.passwords.change`](/docs/sdks/typescript/passwords/change)

```ts
const passwordChanged = await openemail.passwords.change(identityId, { currentPassword: '…', newPassword: '…' })
```
