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

# Update MicroVault strategy

> Sets the vault's target allocation across idle base assets and admitted yield sources. Ground automation subsequently moves assets toward the new targets.

Set target allocations across yield sources and idle USDC. Targets must total 10,000 basis points.


## OpenAPI

````yaml swagger/swagger-combined.yaml PUT /v2/microvaults/vaults/{vaultId}/strategy
openapi: 3.0.0
info:
  title: Ground API
  description: Core API for Portfolio Wallets, gtokens, 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: >-
      Direct access to gtokens with deposit access controls and optional fee
      wrappers.
  - 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}/strategy:
    parameters:
      - name: vaultId
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/UuidV4'
        description: >-
          Ground identifier of the MicroVault. This is distinct from its onchain
          contract address.
    put:
      tags:
        - MicroVaults
      summary: Update target allocations
      description: >-
        Sets the vault's target allocation across idle base assets and admitted
        yield sources. Ground automation subsequently moves assets toward the
        new targets.
      operationId: updateMicrovaultStrategy
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 200
          description: >-
            Unique key for this intended change. Reuse it only when retrying the
            identical request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMicroVaultStrategyRequest'
      responses:
        '202':
          description: The operation was accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultTaskResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          description: Conflicting request.
          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
    UpdateMicroVaultStrategyRequest:
      type: object
      additionalProperties: false
      required:
        - allocations
        - idleTargetBps
      properties:
        allocations:
          type: array
          description: >-
            Yield-source target allocations. Include each source that should
            have a nonzero target.
          items:
            type: object
            additionalProperties: false
            required:
              - sourceId
              - targetBps
            properties:
              sourceId:
                allOf:
                  - $ref: '#/components/schemas/MicroVaultBytes32'
                description: >-
                  Identifier of the admitted yield source that should receive
                  this target allocation.
              targetBps:
                type: integer
                minimum: 0
                maximum: 10000
                description: >-
                  Target share of vault assets for this source in basis points.
                  `8000` means 80%.
        idleTargetBps:
          type: integer
          minimum: 0
          maximum: 10000
          description: >-
            Target share of vault assets kept as unallocated base asset in basis
            points. This value plus all source targets must equal `10000`.
      example:
        allocations:
          - sourceId: '0x1111111111111111111111111111111111111111111111111111111111111111'
            targetBps: 8000
        idleTargetBps: 2000
    MicroVaultTaskResponse:
      type: object
      required:
        - task
      properties:
        task:
          allOf:
            - $ref: '#/components/schemas/MicroVaultTask'
          description: >-
            Asynchronous change accepted for submission and onchain
            confirmation.
      example:
        task:
          id: 924c9b2d-3a9c-4b1a-b470-c73fc9b97c06
          kind: update_strategy
          status: submitted
          vaultId: d9902b20-6499-4465-a4c3-5d2208182f79
          txHashes:
            - '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
          error: null
          createdAt: '2026-09-10T18:42:10.000Z'
          updatedAt: '2026-09-10T18:42:12.000Z'
    MicroVaultError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: invalid_request
          description: Stable machine-readable error code.
        message:
          type: string
          nullable: true
          example: allocation targets and idleTargetBps must total 10000
          description: >-
            Human-readable explanation of why the request failed, when
            available.
        details:
          nullable: true
          description: Structured context for the error, when available.
      example:
        error: invalid_request
        message: allocation targets and idleTargetBps must total 10000
    MicroVaultBytes32:
      type: string
      pattern: ^0x[0-9a-fA-F]{64}$
      example: '0x1111111111111111111111111111111111111111111111111111111111111111'
    MicroVaultTask:
      type: object
      additionalProperties: false
      required:
        - id
        - kind
        - status
        - vaultId
        - txHashes
        - error
        - createdAt
        - updatedAt
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/UuidV4'
          description: Identifier for tracking this requested MicroVault change.
        kind:
          type: string
          enum:
            - provision_vault
            - update_strategy
            - update_source_mode
            - update_fees
            - update_pause
            - add_shareholder
            - remove_shareholder
            - rebalance
          description: Change being performed by this public API task.
        status:
          type: string
          enum:
            - queued
            - submitting
            - submitted
            - confirmed
            - failed
          description: Current submission and onchain-confirmation state of the change.
        vaultId:
          allOf:
            - $ref: '#/components/schemas/UuidV4'
          nullable: true
          description: >-
            Ground MicroVault identifier affected by the task, or `null` until a
            new vault record exists.
        txHashes:
          type: array
          items:
            type: string
            pattern: ^0x[0-9a-fA-F]{64}$
          description: Onchain transaction hashes submitted for this task.
        error:
          type: string
          nullable: true
          description: Failure reason when `status` is `failed`; otherwise `null`.
        createdAt:
          type: string
          format: date-time
          description: Time when Ground accepted the change.
        updatedAt:
          type: string
          format: date-time
          description: Time when the task status last changed.
      example:
        id: 924c9b2d-3a9c-4b1a-b470-c73fc9b97c06
        kind: update_strategy
        status: submitted
        vaultId: d9902b20-6499-4465-a4c3-5d2208182f79
        txHashes:
          - '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
        error: null
        createdAt: '2026-09-10T18:42:10.000Z'
        updatedAt: '2026-09-10T18:42:12.000Z'
    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

````