> ## 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.

# Replace shareholder draft

> Computes a new draft root. Publish it separately with a set_shareholder_root authorization before wallets can use the new proofs.

Replace the proposed shareholder set and compute its Merkle root before publishing it onchain.

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


## OpenAPI

````yaml swagger/swagger-combined.yaml PUT /v2/microvaults/vaults/{vaultId}/shareholders/draft
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}/shareholders/draft:
    parameters:
      - name: vaultId
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/UuidV4'
    put:
      tags:
        - MicroVaults
      summary: Replace the shareholder allowlist draft
      description: >-
        Computes a new draft root. Publish it separately with a
        set_shareholder_root authorization before wallets can use the new
        proofs.
      operationId: replaceMicrovaultShareholderDraft
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MicroVaultShareholderDraftRequest'
      responses:
        '200':
          description: Replacement draft and computed root.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultShareholderDraftResponse'
        '400':
          description: Invalid addresses.
          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'
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
    MicroVaultShareholderDraftRequest:
      type: object
      required:
        - addresses
      additionalProperties: false
      properties:
        addresses:
          type: array
          uniqueItems: true
          items:
            $ref: '#/components/schemas/NonzeroEvmAddress'
      example:
        addresses:
          - '0x3333333333333333333333333333333333333333'
    MicroVaultShareholderDraftResponse:
      type: object
      required:
        - draft
      properties:
        draft:
          type: object
          required:
            - id
            - version
            - root
            - addresses
          properties:
            id:
              $ref: '#/components/schemas/UuidV4'
            version:
              $ref: '#/components/schemas/MicroVaultUint256'
            root:
              $ref: '#/components/schemas/MicroVaultBytes32'
            addresses:
              type: array
              items:
                $ref: '#/components/schemas/NonzeroEvmAddress'
      example:
        draft:
          id: 6898bf67-48e1-4d97-af8a-4e371ce2b23d
          version: '2'
          root: '0x2222222222222222222222222222222222222222222222222222222222222222'
          addresses:
            - '0x3333333333333333333333333333333333333333'
    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'
    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'
    MicroVaultBytes32:
      type: string
      pattern: ^0x[0-9a-fA-F]{64}$
      example: '0x1111111111111111111111111111111111111111111111111111111111111111'
    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.
  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

````