# Run database migrations.

> For the complete documentation index, see [llms.txt](https://bsvblockchain.com/docs/llms.txt).

**POST** `/migrate`

Base URL: `https://{host}/storage/v1`

Applies pending schema migrations.  Returns the migrated storage name
string on success.  Called once during `makeAvailable()`.

## Body

Content type: `application/json`

- `storageName` (string, required)
- `storageIdentityKey` (string, required)

Example:

```json
{
  "storageName": "string",
  "storageIdentityKey": "string"
}
```

## Responses

### 200

Migration completed; returns the storage name.

- `storageName` (string, required)

Example:

```json
{
  "storageName": "string"
}
```

### 401

Authentication required or token invalid.

- `error` (string, required)
- `code` (string)
  Machine-readable error code (see specs/errors.md).

Example:

```json
{
  "error": "string",
  "code": "string"
}
```

### 500

Internal storage error.

- `error` (string, required)
- `code` (string)
  Machine-readable error code (see specs/errors.md).

Example:

```json
{
  "error": "string",
  "code": "string"
}
```