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

# Create a MicroVault authorization

> Validates and simulates a vault action, then returns the payload to authorize.

Validate and simulate an administrative or delegated action, then prepare its exact signing payload.

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


## OpenAPI

````yaml swagger/swagger-combined.yaml POST /v2/microvaults/customers/{customerRecordId}/authorizations
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/customers/{customerRecordId}/authorizations:
    parameters:
      - name: customerRecordId
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/UuidV4'
    post:
      tags:
        - MicroVaults
      summary: Prepare a MicroVault authorization
      description: >-
        Validates and simulates a vault action, then returns the payload to
        authorize.
      operationId: createMicrovaultAuthorization
      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/MicroVaultAuthorizationBuildRequest'
      responses:
        '200':
          description: Existing authorization returned for an identical replay.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultAuthorization'
        '201':
          description: >-
            Authorization prepared and managed approval initiated when
            applicable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultAuthorization'
        '400':
          description: Invalid action or parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Customer or vault not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultError'
        '409':
          description: Stale state or idempotency conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultError'
        '422':
          description: Onchain simulation reverted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MicroVaultError'
        '503':
          description: Simulation temporarily unavailable.
          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
    MicroVaultAuthorizationBuildRequest:
      oneOf:
        - $ref: '#/components/schemas/MicroVaultCreateAuthorizationRequest'
        - $ref: '#/components/schemas/MicroVaultShareholderRootAuthorizationRequest'
        - $ref: '#/components/schemas/MicroVaultFeeRecipientAuthorizationRequest'
        - $ref: '#/components/schemas/MicroVaultManagementFeeAuthorizationRequest'
        - $ref: '#/components/schemas/MicroVaultPerformanceFeeAuthorizationRequest'
        - $ref: '#/components/schemas/MicroVaultSourceModeAuthorizationRequest'
        - $ref: '#/components/schemas/MicroVaultAllocationAuthorizationRequest'
        - $ref: '#/components/schemas/MicroVaultAddPauseFlagsAuthorizationRequest'
        - $ref: '#/components/schemas/MicroVaultRemovePauseFlagsAuthorizationRequest'
      discriminator:
        propertyName: action
    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
    MicroVaultCreateAuthorizationRequest:
      title: Create vault
      type: object
      additionalProperties: false
      required:
        - action
        - parameters
      properties:
        action:
          type: string
          enum:
            - create_vault
        parameters:
          type: object
          additionalProperties: false
          required:
            - customerVaultNonce
            - baseAsset
            - name
            - symbol
            - feeRecipient
            - managementFeeBps
            - performanceFeeBps
          properties:
            customerVaultNonce:
              $ref: '#/components/schemas/MicroVaultUint256'
            baseAsset:
              $ref: '#/components/schemas/NonzeroEvmAddress'
            name:
              type: string
              maxLength: 64
            symbol:
              type: string
              maxLength: 16
            feeRecipient:
              $ref: '#/components/schemas/NonzeroEvmAddress'
            managementFeeBps:
              type: integer
              minimum: 0
              maximum: 9999
            performanceFeeBps:
              type: integer
              minimum: 0
              maximum: 9999
            initialDelegate:
              $ref: '#/components/schemas/NonzeroEvmAddress'
            initialDelegationPolicyRoot:
              $ref: '#/components/schemas/MicroVaultBytes32'
            predictedVault:
              $ref: '#/components/schemas/NonzeroEvmAddress'
        deadline:
          type: integer
          description: Unix timestamp no more than seven days in the future.
        nonce:
          $ref: '#/components/schemas/MicroVaultUint256'
        supersedesIntentId:
          type: string
          minLength: 1
          maxLength: 64
      example:
        action: create_vault
        parameters:
          customerVaultNonce: '3'
          baseAsset: '0x1c7d4b196cb0c7b01d743fbc6116a902379c7238'
          name: Acme Treasury MicroVault
          symbol: acmeUSDC
          feeRecipient: '0x1111111111111111111111111111111111111111'
          managementFeeBps: 25
          performanceFeeBps: 1000
        deadline: 1789088400
        nonce: '7'
    MicroVaultShareholderRootAuthorizationRequest:
      title: Set shareholder root
      type: object
      additionalProperties: false
      required:
        - action
        - vaultId
        - authorizationMode
        - parameters
      properties:
        action:
          type: string
          enum:
            - set_shareholder_root
        vaultId:
          $ref: '#/components/schemas/UuidV4'
        authorizationMode:
          $ref: '#/components/schemas/MicroVaultAuthorizationMode'
        delegateAddress:
          $ref: '#/components/schemas/NonzeroEvmAddress'
        parameters:
          type: object
          additionalProperties: false
          required:
            - root
          properties:
            root:
              $ref: '#/components/schemas/MicroVaultBytes32'
        deadline:
          type: integer
        nonce:
          $ref: '#/components/schemas/MicroVaultUint256'
        supersedesIntentId:
          type: string
          minLength: 1
          maxLength: 64
      example:
        action: set_shareholder_root
        vaultId: d9902b20-6499-4465-a4c3-5d2208182f79
        authorizationMode: customer
        parameters:
          root: '0x2222222222222222222222222222222222222222222222222222222222222222'
        deadline: 1789088400
        nonce: '8'
    MicroVaultFeeRecipientAuthorizationRequest:
      title: Set fee recipient
      type: object
      additionalProperties: false
      required:
        - action
        - vaultId
        - parameters
      properties:
        action:
          type: string
          enum:
            - set_fee_recipient
        vaultId:
          $ref: '#/components/schemas/UuidV4'
        parameters:
          type: object
          additionalProperties: false
          required:
            - recipient
          properties:
            recipient:
              $ref: '#/components/schemas/NonzeroEvmAddress'
        deadline:
          type: integer
        nonce:
          $ref: '#/components/schemas/MicroVaultUint256'
        supersedesIntentId:
          type: string
          minLength: 1
          maxLength: 64
      example:
        action: set_fee_recipient
        vaultId: d9902b20-6499-4465-a4c3-5d2208182f79
        parameters:
          recipient: '0x9999999999999999999999999999999999999999'
        deadline: 1789088400
        nonce: '9'
    MicroVaultManagementFeeAuthorizationRequest:
      title: Set management fee
      type: object
      additionalProperties: false
      required:
        - action
        - vaultId
        - authorizationMode
        - parameters
      properties:
        action:
          type: string
          enum:
            - set_management_fee
        vaultId:
          $ref: '#/components/schemas/UuidV4'
        authorizationMode:
          $ref: '#/components/schemas/MicroVaultAuthorizationMode'
        delegateAddress:
          $ref: '#/components/schemas/NonzeroEvmAddress'
        parameters:
          type: object
          additionalProperties: false
          required:
            - value
          properties:
            value:
              type: integer
              minimum: 0
              maximum: 9999
        deadline:
          type: integer
        nonce:
          $ref: '#/components/schemas/MicroVaultUint256'
        supersedesIntentId:
          type: string
          minLength: 1
          maxLength: 64
      example:
        action: set_management_fee
        vaultId: d9902b20-6499-4465-a4c3-5d2208182f79
        authorizationMode: customer
        parameters:
          value: 25
        deadline: 1789088400
        nonce: '10'
    MicroVaultPerformanceFeeAuthorizationRequest:
      title: Set performance fee
      type: object
      additionalProperties: false
      required:
        - action
        - vaultId
        - authorizationMode
        - parameters
      properties:
        action:
          type: string
          enum:
            - set_performance_fee
        vaultId:
          $ref: '#/components/schemas/UuidV4'
        authorizationMode:
          $ref: '#/components/schemas/MicroVaultAuthorizationMode'
        delegateAddress:
          $ref: '#/components/schemas/NonzeroEvmAddress'
        parameters:
          type: object
          additionalProperties: false
          required:
            - value
          properties:
            value:
              type: integer
              minimum: 0
              maximum: 9999
        deadline:
          type: integer
        nonce:
          $ref: '#/components/schemas/MicroVaultUint256'
        supersedesIntentId:
          type: string
          minLength: 1
          maxLength: 64
      example:
        action: set_performance_fee
        vaultId: d9902b20-6499-4465-a4c3-5d2208182f79
        authorizationMode: customer
        parameters:
          value: 1000
        deadline: 1789088400
        nonce: '11'
    MicroVaultSourceModeAuthorizationRequest:
      title: Set source mode
      type: object
      additionalProperties: false
      required:
        - action
        - vaultId
        - parameters
      properties:
        action:
          type: string
          enum:
            - set_source_mode
        vaultId:
          $ref: '#/components/schemas/UuidV4'
        parameters:
          type: object
          additionalProperties: false
          required:
            - sourceId
            - mode
          properties:
            sourceId:
              $ref: '#/components/schemas/MicroVaultBytes32'
            mode:
              $ref: '#/components/schemas/MicroVaultSourceMode'
        deadline:
          type: integer
        nonce:
          $ref: '#/components/schemas/MicroVaultUint256'
        supersedesIntentId:
          type: string
          minLength: 1
          maxLength: 64
      example:
        action: set_source_mode
        vaultId: d9902b20-6499-4465-a4c3-5d2208182f79
        parameters:
          sourceId: '0x1111111111111111111111111111111111111111111111111111111111111111'
          mode: active
        deadline: 1789088400
        nonce: '12'
    MicroVaultAllocationAuthorizationRequest:
      title: Set allocations
      type: object
      additionalProperties: false
      required:
        - action
        - vaultId
        - authorizationMode
        - parameters
      properties:
        action:
          type: string
          enum:
            - set_allocation_targets
        vaultId:
          $ref: '#/components/schemas/UuidV4'
        authorizationMode:
          $ref: '#/components/schemas/MicroVaultAuthorizationMode'
        delegateAddress:
          $ref: '#/components/schemas/NonzeroEvmAddress'
        parameters:
          type: object
          additionalProperties: false
          required:
            - sourceIds
            - targetBps
          properties:
            sourceIds:
              type: array
              maxItems: 8
              items:
                $ref: '#/components/schemas/MicroVaultBytes32'
            targetBps:
              type: array
              maxItems: 8
              items:
                type: integer
                minimum: 0
                maximum: 10000
        deadline:
          type: integer
        nonce:
          $ref: '#/components/schemas/MicroVaultUint256'
        supersedesIntentId:
          type: string
          minLength: 1
          maxLength: 64
      example:
        action: set_allocation_targets
        vaultId: d9902b20-6499-4465-a4c3-5d2208182f79
        authorizationMode: customer
        parameters:
          sourceIds:
            - '0x1111111111111111111111111111111111111111111111111111111111111111'
          targetBps:
            - 8000
        deadline: 1789088400
        nonce: '13'
    MicroVaultAddPauseFlagsAuthorizationRequest:
      title: Add pause flags
      type: object
      additionalProperties: false
      required:
        - action
        - vaultId
        - authorizationMode
        - parameters
      properties:
        action:
          type: string
          enum:
            - add_pause_flags
        vaultId:
          $ref: '#/components/schemas/UuidV4'
        authorizationMode:
          $ref: '#/components/schemas/MicroVaultAuthorizationMode'
        delegateAddress:
          $ref: '#/components/schemas/NonzeroEvmAddress'
        parameters:
          type: object
          additionalProperties: false
          required:
            - flags
          properties:
            flags:
              type: integer
              minimum: 1
              maximum: 31
        deadline:
          type: integer
        nonce:
          $ref: '#/components/schemas/MicroVaultUint256'
        supersedesIntentId:
          type: string
          minLength: 1
          maxLength: 64
      example:
        action: add_pause_flags
        vaultId: d9902b20-6499-4465-a4c3-5d2208182f79
        authorizationMode: customer
        parameters:
          flags: 3
        deadline: 1789088400
        nonce: '14'
    MicroVaultRemovePauseFlagsAuthorizationRequest:
      title: Remove pause flags
      type: object
      additionalProperties: false
      required:
        - action
        - vaultId
        - authorizationMode
        - parameters
      properties:
        action:
          type: string
          enum:
            - remove_pause_flags
        vaultId:
          $ref: '#/components/schemas/UuidV4'
        authorizationMode:
          $ref: '#/components/schemas/MicroVaultAuthorizationMode'
        delegateAddress:
          $ref: '#/components/schemas/NonzeroEvmAddress'
        parameters:
          type: object
          additionalProperties: false
          required:
            - flags
          properties:
            flags:
              type: integer
              minimum: 1
              maximum: 31
        deadline:
          type: integer
        nonce:
          $ref: '#/components/schemas/MicroVaultUint256'
        supersedesIntentId:
          type: string
          minLength: 1
          maxLength: 64
      example:
        action: remove_pause_flags
        vaultId: d9902b20-6499-4465-a4c3-5d2208182f79
        authorizationMode: customer
        parameters:
          flags: 3
        deadline: 1789088400
        nonce: '15'
    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'
    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'
    MicroVaultAuthorizationMode:
      type: string
      enum:
        - customer
        - delegate
      description: >-
        Customer uses the vault authority; delegate uses an installed delegation
        policy.
    MicroVaultSourceMode:
      type: string
      enum:
        - active
        - buy_only
        - sell_only
        - disabled
      description: >-
        Active permits source entry and exit; buy_only permits new allocations
        into the source; sell_only permits exits from the source; disabled
        permits neither.
  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

````