---
title: "Reset a mailbox password and return the new one-time password"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.hostedez.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Hosted EZ REST API

`POST /v1/email/mailboxes/{id}/password`

## Authentication

- `sessionCookie`, apiKey, in cookie

## Path parameters

- `resetEmailMailboxPassword.path.id` (string, required) — Email mailbox ID (mbx_...).

## Header parameters

- `resetEmailMailboxPassword.header.Idempotency-Key` (string, optional) — Optional idempotency key (1 to 255 printable ASCII characters) scoped to caller and route.
  - minLength 1; maxLength 255

## Request body

_Optional._

- `resetEmailMailboxPassword.password` (string | null, optional)

## Example request

```json
{
  "password": "string"
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://api.hostedez.com/v1/email/mailboxes/string/password \
  --header 'Content-Type: application/json' \
  --header '__Secure-better-auth.session_token: <value>' \
  --data '
{
  "password": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.hostedez.com/v1/email/mailboxes/string/password';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    '__Secure-better-auth.session_token': '<value>'
  },
  body: JSON.stringify({password: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.hostedez.com/v1/email/mailboxes/string/password"

payload = { "password": "string" }
headers = {
    "Content-Type": "application/json",
    "__Secure-better-auth.session_token": "<value>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Password reset

#### Example

```json
{
  "address": "string",
  "mailbox": {
    "address": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "displayName": "string",
    "domain": "string",
    "emailDomainId": "string",
    "id": "string",
    "lastLoginAt": "2019-08-24T14:15:22Z",
    "localPart": "string",
    "mailNodeId": "string",
    "quotaBytes": 0,
    "status": "active",
    "updatedAt": "2019-08-24T14:15:22Z",
    "usedBytes": 0,
    "userId": "string"
  },
  "password": "string"
}
```

- `resetEmailMailboxPassword.response.200.address` (string, required)
- `resetEmailMailboxPassword.response.200.mailbox` (object, required)
  - `resetEmailMailboxPassword.response.200.mailbox.address` (string, required)
  - `resetEmailMailboxPassword.response.200.mailbox.createdAt` (string, required)
    - format `date-time`
  - `resetEmailMailboxPassword.response.200.mailbox.displayName` (string, required)
  - `resetEmailMailboxPassword.response.200.mailbox.domain` (string, required)
  - `resetEmailMailboxPassword.response.200.mailbox.emailDomainId` (string, required)
  - `resetEmailMailboxPassword.response.200.mailbox.id` (string, required)
  - `resetEmailMailboxPassword.response.200.mailbox.lastLoginAt` (string | null, required)
    - format `date-time`
  - `resetEmailMailboxPassword.response.200.mailbox.localPart` (string, required)
  - `resetEmailMailboxPassword.response.200.mailbox.mailNodeId` (string | null, required)
  - `resetEmailMailboxPassword.response.200.mailbox.quotaBytes` (integer, required)
    - format `int64`
  - `resetEmailMailboxPassword.response.200.mailbox.status` (string, required)
    - one of `"active"`, `"suspended"`, `"deleting"`
  - `resetEmailMailboxPassword.response.200.mailbox.updatedAt` (string, required)
    - format `date-time`
  - `resetEmailMailboxPassword.response.200.mailbox.usedBytes` (integer, required)
    - format `int64`
  - `resetEmailMailboxPassword.response.200.mailbox.userId` (string, required)
- `resetEmailMailboxPassword.response.200.password` (string, required) — One-time auto-generated password; empty when a custom password was supplied.

### 400

Invalid password

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `resetEmailMailboxPassword.response.400.error` (object, required)
  - `resetEmailMailboxPassword.response.400.error.code` (string, required)
  - `resetEmailMailboxPassword.response.400.error.message` (string, required)
  - `resetEmailMailboxPassword.response.400.error.issues` (array<object>, optional)
    - `resetEmailMailboxPassword.response.400.error.issues.message` (string, required)
    - `resetEmailMailboxPassword.response.400.error.issues.path` (string, required)

### 401

Unauthenticated

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `resetEmailMailboxPassword.response.401.error` (object, required)
  - `resetEmailMailboxPassword.response.401.error.code` (string, required)
  - `resetEmailMailboxPassword.response.401.error.message` (string, required)
  - `resetEmailMailboxPassword.response.401.error.issues` (array<object>, optional)
    - `resetEmailMailboxPassword.response.401.error.issues.message` (string, required)
    - `resetEmailMailboxPassword.response.401.error.issues.path` (string, required)

### 403

Forbidden origin

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `resetEmailMailboxPassword.response.403.error` (object, required)
  - `resetEmailMailboxPassword.response.403.error.code` (string, required)
  - `resetEmailMailboxPassword.response.403.error.message` (string, required)
  - `resetEmailMailboxPassword.response.403.error.issues` (array<object>, optional)
    - `resetEmailMailboxPassword.response.403.error.issues.message` (string, required)
    - `resetEmailMailboxPassword.response.403.error.issues.path` (string, required)

### 404

Mailbox not found

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `resetEmailMailboxPassword.response.404.error` (object, required)
  - `resetEmailMailboxPassword.response.404.error.code` (string, required)
  - `resetEmailMailboxPassword.response.404.error.message` (string, required)
  - `resetEmailMailboxPassword.response.404.error.issues` (array<object>, optional)
    - `resetEmailMailboxPassword.response.404.error.issues.message` (string, required)
    - `resetEmailMailboxPassword.response.404.error.issues.path` (string, required)


Source: https://docs.hostedez.com/api/resetEmailMailboxPassword/index.md
