# Migrate
**POST /wallets/{walletId}/migrations**
Migrate the UTxO balance of this wallet to the given set of addresses.
This operation will attempt to transfer as much of the wallet's balance
as possible to the given set of addresses, by creating and submitting
as many transactions as may be necessary to migrate the entire balance.
In order to minimize the total transaction fee required, UTxO entries
are coalesced together to the greatest extent possible in the resulting
transactions. No attempt is made to preserve the wallet's UTxO
distribution.
This operation is performed on a best-effort basis. If there is
insufficient ada available to pay for the entire UTxO set to be
migrated, then only a subset of the wallet's UTxO set will be migrated.
A typical use of this operation would be to move all funds from an old
wallet to a new wallet, by providing addresses that belong to the new
wallet.
## Servers
- https://localhost:8090/v2: https://localhost:8090/v2 ()
## Parameters
### Path parameters
- **walletId** (string(hex))
### Body: application/json (object)
- **passphrase** (string)
The wallet's master passphrase.
- **addresses** (array[string(base58|bech32)])
A sequence of characters that encodes (in Base58 or Bech32) a sequence of bytes
which represents an address on the Cardano blockchain.
Sequences in Base58 encoding are expected to be legacy Byron addresses,
whereas sequences in Bech32 encoding correspond to current Shelley addresses.
For more details, see
[CIP-0019 — Cardano addresses](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0019)
.
## Responses
### 403
Forbidden
#### Body: application/json (object)
- **message** (string)
May occur when trying to migrate a wallet that is empty or full of dust.
- **code** (string)
### 404
Not Found
#### Body: application/json (object)
- **message** (string)
May occur when a given walletId does not match with any known
wallets (because it has been deleted, or has never existed).
- **code** (string)
### 406
Not Acceptable
#### Body: application/json (object)
- **message** (string)
May occur when providing an invalid 'Accept' header.
- **code** (string)
### 415
Unsupported Media Type
#### Body: application/json (object)
- **message** (string)
May occur when providing an invalid 'Content-Type' header.
- **code** (string)
### 202
Accepted
#### Body: application/json (array[object])
- **id** (string(hex))
A unique identifier for this transaction
- **amount** (object)
An amount of Ada spent or received, from the perspective of the wallet.
That is, for outgoing transaction, it represents the amount of Ada consumed
as inputs including the amount of Ada spent as fees or deposits.
For incoming transaction, it represents the total amount of Ada received to
addresses that belong to the wallet.
- **fee** (object)
Coins, in Lovelace. Only relates to 'Ada'. Refer to `assets` for multi-assets wallets instead.
- **deposit_taken** (object)
Coins, in Lovelace. Only relates to 'Ada'. Refer to `assets` for multi-assets wallets instead.
- **deposit_returned** (object)
Coins, in Lovelace. Only relates to 'Ada'. Refer to `assets` for multi-assets wallets instead.
- **inserted_at** (object)
A reference to a particular time slot, and the block height at that point.
- **expires_at** (object)
A reference to a particular time slot.
- **pending_since** (object)
A reference to a particular time slot, and the block height at that point.
- **depth** (object)
if: status == in_ledger
Current depth of the transaction in the local chain
- **direction** (string)
- **inputs** (array[object])
A list of transaction inputs.
`assets` and `address` are always present for `outgoing`
transactions but generally absent for `incoming`
transactions. This information is present on the Cardano explorer,
but is not tracked by the wallet.
- **outputs** (array[object])
A list of target outputs with amounts specified.
When creating a new transaction, the wallet software ensures that all
user-specified transaction outputs have ada amounts that satisfy the ledger
minimum UTxO rule:
- If a user-specified transaction output has an ada `amount` that is
**zero**, the wallet software will automatically assign a minimal amount
of ada to the output so that it satisfies the ledger minimum UTxO rule.
- If a user-specified transaction output has an ada `amount` that is
**non-zero**, the wallet software will verify that the specified amount
is large enough to satisfy the ledger minimum UTxO rule. If the amount is
not large enough, the wallet software will return a `utxo_too_small`
error, together with a revised ada amount that does satisfy the minimum
UTxO rule.
- **collateral** (array[object])
A list of transaction inputs used for collateral.
- **collateral_outputs** (array[object])
A list of collateral return outputs with amounts specified.
- **withdrawals** (array[object])
A list of withdrawals from stake addresses.
- **status** (string)
Current transaction status.
```
*-----------*
---> | PENDING |----------------*
*-----------* |
| |
V V
*-----------* *-----------*
| |----------> EXPIRED |
| | (ttl) *-----------*
| SUBMITTED |
| <----------------*
| | |
*-----------* (rollback)
| |
(in ledger) *-----------*
| | |
*---------------> IN_LEDGER |
| |
*-----------*
```
- **metadata** (object | null)
- **script_validity** (string | null)
Indicates whether the phase-2 monetary policy script (e.g. Plutus script)
used in the transaction validated or not. Validity may be null if this
transaction was from an era that doesn't support phase-2 monetary policy
scripts, or is a pending transaction (we don't know if validation passed or
failed until the transaction hits the ledger).
- **certificates** (array[object])
Any certificate that could occur in an arbitrary transaction:
might be related to delegation, pool activities, genesis or MIR.
- **mint** (object)
- **burn** (object)
- **validity_interval** (object)
- **script_integrity** (string(bech32))
A script data integrity hash - 32 bytes
- **extra_signatures** (array[string(bech32)])
An extra signature hash - 28 bytes
[Powered by Bump.sh](https://bump.sh)