> ## 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 MicroVault authority

> Prepares the irreversible transfer of this vault's authority to another EOA or ERC-1271 contract.

Prepare an irreversible authority transfer away from Ground's managed operation.

<Note>
  MicroVaults are in private preview for enabled sandbox organizations on Ethereum Sepolia.
</Note>


## OpenAPI

````yaml swagger/swagger-combined.yaml POST /v2/microvaults/vaults/{vaultId}/export
openapi: 3.0.0
info:
  title: Ground API
  description: Core API for Portfolio Wallets, gVaults, MicroVaults, and webhooks.
  version: 2.0.0
servers:
  - url: https://sandbox.groundtech.co
  - url: https://production.groundtech.co
security:
  - bearerAuth: []
tags:
  - name: System
    description: System health and utility endpoints.
  - name: Sandbox Faucets
    description: Sandbox-only test token faucets.
  - name: Portfolio Wallets
    description: >-
      Portfolio wallets with strategy allocation, deposits, withdrawals, and
      yield positions.
  - name: gVaults
    description: App-specific Ground vaults with customer access and fee sharing.
  - name: MicroVaults
    description: >-
      Customer-owned onchain vaults with externally held ERC-20 shares. Private
      preview in sandbox on Ethereum Sepolia.
  - name: Webhook Endpoints
    description: Webhook endpoint management for portfolio wallet notifications.
paths:
  /v2/microvaults/vaults/{vaultId}/export:
    parameters:
      - name: vaultId
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/UuidV4'
    post:
      tags:
        - MicroVaults
      summary: Prepare a vault-authority export
      description: >-
        Prepares the irreversible transfer of this vault's authority to another
        EOA or ERC-1271 contract.
      operationId: exportMicrovaultAuthority
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 200
          description: Reuse only when retrying the identical mutation.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MicroVaultExportRequest'
      responses:
        '200':
          description: Existing authorization returned for an identical replay.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultAuthorization'
        '201':
          description: Export authorization prepared.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultAuthorization'
        '400':
          description: Invalid authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Vault not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultError'
        '409':
          description: Already exported, stale state, or idempotency conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultError'
components:
  schemas:
    UuidV4:
      type: string
      format: uuid
      pattern: >-
        ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$
      example: 8f4c52d7-62ab-4db9-a964-92f481f6b851
    MicroVaultExportRequest:
      type: object
      required:
        - newAuthority
      additionalProperties: false
      properties:
        newAuthority:
          $ref: '#/components/schemas/NonzeroEvmAddress'
      example:
        newAuthority: '0x9999999999999999999999999999999999999999'
    MicroVaultAuthorization:
      type: object
      required:
        - id
        - status
        - signingPayload
        - signingPayloadHash
        - summary
        - predictedEffects
        - simulation
      additionalProperties: true
      properties:
        id:
          $ref: '#/components/schemas/UuidV4'
        status:
          type: string
        signingPayload:
          type: object
          additionalProperties: true
        signingPayloadHash:
          $ref: '#/components/schemas/MicroVaultBytes32'
        summary:
          type: object
          additionalProperties: true
        predictedEffects:
          type: array
          items:
            type: object
            additionalProperties: true
        simulation:
          type: object
          additionalProperties: true
        turnkeyActivityId:
          type: string
          nullable: true
        turnkeyStatus:
          type: string
          nullable: true
        directTransaction:
          $ref: '#/components/schemas/MicroVaultDirectTransaction'
      example:
        id: 4f36d486-58c9-441b-8535-6097ad3f1832
        status: awaiting_signature
        signingPayload:
          action: set_source_mode
          chainId: 11155111
          vault: '0x2222222222222222222222222222222222222222'
          parameters:
            sourceId: '0x1111111111111111111111111111111111111111111111111111111111111111'
            mode: active
        signingPayloadHash: '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
        summary:
          text: Set Morpho Steakhouse USDC Prime to active
        predictedEffects:
          - kind: source_mode
            sourceId: '0x1111111111111111111111111111111111111111111111111111111111111111'
            mode: active
        simulation:
          ok: true
        turnkeyActivityId: null
        turnkeyStatus: null
    MicroVaultError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Stable machine-readable error code.
        message:
          type: string
          nullable: true
        details:
          nullable: true
      example:
        error: microvaults_not_enabled
        message: MicroVaults are not enabled for this organization
    NonzeroEvmAddress:
      type: string
      description: >-
        Valid nonzero EVM EOA or contract address. Mixed-case values must use a
        valid EIP-55 checksum.
      minLength: 42
      maxLength: 42
      pattern: ^0x(?!0{40}$)[0-9a-fA-F]{40}$
      example: '0x3bf25a73a1f1033c2d50ac65f3c9d6a44123db81'
    MicroVaultBytes32:
      type: string
      pattern: ^0x[0-9a-fA-F]{64}$
      example: '0x1111111111111111111111111111111111111111111111111111111111111111'
    MicroVaultDirectTransaction:
      type: object
      required:
        - to
        - data
        - value
      properties:
        to:
          $ref: '#/components/schemas/NonzeroEvmAddress'
        data:
          type: string
          pattern: ^0x[0-9a-fA-F]*$
        value:
          $ref: '#/components/schemas/MicroVaultUint256'
      example:
        to: '0x2222222222222222222222222222222222222222'
        data: '0x12345678'
        value: '0'
    AuthErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Authentication or authorization error message.
        message:
          type: string
          nullable: true
          description: Additional auth middleware detail, when present.
        code:
          type: string
          nullable: true
          enum:
            - unauthenticated
            - forbidden
          description: >-
            Some auth and scope failures include a stable code; middleware
            errors may omit it.
    MicroVaultUint256:
      type: string
      pattern: ^(0|[1-9][0-9]*)$
      description: >-
        Unsigned base-10 integer string. Asset and share amounts use token base
        units.
      example: '1000000'
  responses:
    Unauthorized:
      description: >-
        The request is missing a valid bearer token, or the token is invalid or
        expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthErrorResponse'
          example:
            error: Unauthenticated request
            message: Missing or invalid bearer token
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````