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

# Export vault authority

> Transfer one MicroVault from Ground management to an authority you control.

Export transfers one vault's administrative authority to an EOA or ERC-1271 contract you control. After confirmation, Ground can continue reporting the vault but cannot manage its strategy, fees, shareholder root, pauses, or source operations.

## Prerequisites

* The `VAULT_ID` to export
* The destination authority address
* Confirmation that the destination can perform every required vault administration action
* No in-progress vault update that you expect Ground to finish

Export affects only the selected vault. It does not move shareholder assets or shares and does not change your other MicroVaults.

## 1. Prepare the export

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export GROUND_API="https://sandbox.groundtech.co"
export GROUND_API_KEY="..."
export AUTH="Authorization: Bearer $GROUND_API_KEY"
export VAULT_ID="d9902b20-6499-4465-a4c3-5d2208182f79"
export EXPORT_REQUEST_ID="$(uuidgen)"

curl -sS -X POST "$GROUND_API/v2/microvaults/vaults/$VAULT_ID/export" \
  -H "$AUTH" \
  -H 'Content-Type: application/json' \
  -H "Idempotency-Key: $EXPORT_REQUEST_ID" \
  -d '{
    "newAuthority": "0x5555555555555555555555555555555555555555"
  }'
```

Review the returned `summary`, `requiredSigner`, target address, and simulation before authorizing it. Save the returned authorization `id` as `INTENT_ID`.

## 2. Authorize and relay

When managed approval has not already started, sign the returned EIP-712 payload with the current vault authority and submit it:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -sS -X POST "$GROUND_API/v2/microvaults/authorizations/$INTENT_ID/relay" \
  -H "$AUTH" \
  -H 'Content-Type: application/json' \
  -d '{"signature":"0x..."}'
```

When the prepared response contains `turnkeyActivityId`, poll the authorization instead; the managed approval is already in progress.

## 3. Wait for confirmation

```javascript theme={"theme":{"light":"github-light","dark":"github-dark"}}
async function waitForExport(intentId) {
  for (;;) {
    const response = await fetch(
      `${process.env.GROUND_API}/v2/microvaults/authorizations/${intentId}`,
      { headers: { Authorization: `Bearer ${process.env.GROUND_API_KEY}` } },
    );
    if (!response.ok) throw new Error(await response.text());
    const authorization = await response.json();
    if (["confirmed", "executed"].includes(authorization.status)) return authorization;
    if (["rejected", "superseded", "expired"].includes(authorization.status)) {
      throw new Error(`Export ended with ${authorization.status}`);
    }
    await new Promise((resolve) => setTimeout(resolve, 1500));
  }
}
```

## Confirm the export

Fetch `GET /v2/microvaults/vaults/{vaultId}` and verify that `exported` is `true` and `authorityAddress` is the destination you supplied. Stop sending Ground-managed mutation requests for that vault.

A `409 already_exported` means authority has already moved. Verify the current authority on the vault before taking further action. Because the old authority cannot reverse the transfer after confirmation, recovering management requires cooperation from the new authority.
