---
title: "Rotate the password of the database's isolated MariaDB user"
---

> 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/databases/{id}/rotate-password`

## Authentication

- `sessionCookie`, apiKey, in cookie

## Path parameters

- `rotateDatabasePassword.path.id` (string, required) — Customer database ID (db_...).

## Code samples

### cURL

```curl
curl --request POST \
  --url https://api.hostedez.com/v1/databases/string/rotate-password \
  --header '__Secure-better-auth.session_token: <value>'
```

### TypeScript

```typescript
const url = 'https://api.hostedez.com/v1/databases/string/rotate-password';
const options = {method: 'POST', headers: {'__Secure-better-auth.session_token': '<value>'}};

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/databases/string/rotate-password"

headers = {"__Secure-better-auth.session_token": "<value>"}

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

print(response.text)
```

## Responses

### 200

Password rotation started

#### Example

```json
{
  "ok": true,
  "status": "string"
}
```

- `rotateDatabasePassword.response.200.ok` (boolean, required)
- `rotateDatabasePassword.response.200.status` (string, required)

### 401

Unauthenticated

#### Example

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

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

### 403

Forbidden origin

#### Example

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

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

### 404

Database not found

#### Example

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

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

### 409

Database is not available

#### Example

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

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

### 503

Database service unavailable

#### Example

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

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


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