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

# Withdraw from vault

> Withdraw assets from an ERC-4626 yield vault.

<Tip>
  If your app has gas sponsorship configured, usage of the `/earn/ethereum/withdraw` endpoint will
  be [gas-sponsored by default](/wallets/actions/overview#gas-management). There is no need to
  specify additional parameters for sponsorship.
</Tip>


## OpenAPI

````yaml post /v1/wallets/{wallet_id}/earn/ethereum/withdraw
openapi: 3.1.0
info:
  version: 0.0.1
  title: Privy API
  description: >-
    REST API for Privy's wallet infrastructure — provision and manage wallets
    across EVM, Solana, and Bitcoin, authenticate users, sign transactions, and
    configure programmable policies and authorization intents.
  contact:
    name: Privy
    url: https://www.privy.io/
    email: support@privy.io
servers:
  - url: https://api.privy.io
security: []
tags:
  - name: Accounts
    description: Operations related to asset accounts
  - name: Aggregations
    description: Operations related to aggregations for tracking and measuring metrics
  - name: Apps
    description: Operations related to app settings and allowlist management
  - name: Client Auth
    description: OAuth token exchange and device authorization operations
  - name: Condition Sets
    description: Operations related to condition sets
  - name: Embedded wallets
    description: Operations related to embedded wallet creation and authentication
  - name: Fiat
    description: Operations related to fiat onramping and offramping
  - name: Intents
    description: Operations related to authorization intents for wallet actions
  - name: Key quorums
    description: Operations related to key quorums
  - name: Kraken Embed
    description: >-
      Operations for Kraken Embed integration, including quotes, trades, user
      management, and portfolio operations
  - name: OAuth
    description: >-
      OAuth 2.0 endpoints including Device Authorization Grant (RFC 8628) for
      CLI and limited-input device login flows
  - name: Organizations
    description: Operations related to organization secret management
  - name: Policies
    description: Operations related to policies
  - name: Shared
    description: Common schemas shared across resources
  - name: Swaps
    description: Operations for swapping tokens within wallets
  - name: Transactions
    description: Operations related to transactions
  - name: User signers
    description: Operations related to user signers
  - name: Users
    description: Operations related to users
  - name: Wallet Actions
    description: Operations related to wallet actions
  - name: Wallets
    description: Operations related to wallets
  - name: Webhooks
    description: >-
      Webhook events that Privy sends to your configured endpoint when specific
      actions occur in your app
  - name: Yield
    description: >-
      Operations for depositing and withdrawing funds from ERC-4626 yield vaults
      (Morpho, Aave)
paths:
  /v1/wallets/{wallet_id}/earn/ethereum/withdraw:
    post:
      tags:
        - Wallet Actions
      summary: Earn withdraw
      description: Withdraw assets from an ERC-4626 vault.
      operationId: ethereumEarnWithdraw
      parameters:
        - schema:
            type: string
            description: ID of the wallet.
          required: true
          name: wallet_id
          in: path
        - schema:
            type: string
            description: ID of your Privy app.
          required: true
          name: privy-app-id
          in: header
        - schema:
            type: string
            description: >-
              Request authorization signature. If multiple signatures are
              required, they should be comma separated.
          required: false
          name: privy-authorization-signature
          in: header
        - schema:
            type: string
            description: >-
              Request expiry. Value is a Unix timestamp in milliseconds
              representing the deadline by which the request must be processed.
          required: false
          name: privy-request-expiry
          in: header
        - schema:
            type: string
            description: >-
              Idempotency keys ensure API requests are executed only once within
              a 24-hour window.
          required: false
          name: privy-idempotency-key
          in: header
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EarnWithdrawRequestBody'
            example:
              vault_id: cm7oxq1el000e11o8iwp7d0d0
              amount: '1.5'
      responses:
        '200':
          description: Earn withdraw initiated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EarnWithdrawActionResponse'
              example:
                id: 550e8400-e29b-41d4-a716-446655440000
                status: pending
                wallet_id: fmfdj6yqly31huorjqzq38zc
                type: earn_withdraw
                caip2: eip155:8453
                vault_id: cm7oxq1el000e11o8iwp7d0d0
                vault_address: '0x1234567890abcdef1234567890abcdef12345678'
                asset: usdc
                asset_address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
                decimals: 6
                amount: '1.5'
                raw_amount: '1500000'
                share_amount: null
      security:
        - appSecretAuth: []
components:
  schemas:
    EarnWithdrawRequestBody:
      type: object
      properties:
        vault_id:
          type: string
          description: The ID of the vault to withdraw from.
        amount:
          type: string
          minLength: 1
          maxLength: 200
          pattern: ^\d+(\.\d+)?$
          description: >-
            Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC).
            Exactly one of `amount` or `raw_amount` must be provided.
        raw_amount:
          type: string
          minLength: 1
          maxLength: 78
          pattern: ^\d+$
          description: >-
            Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC
            with 6 decimals). Exactly one of `amount` or `raw_amount` must be
            provided.
      required:
        - vault_id
      additionalProperties: false
      description: >-
        Input for withdrawing assets from an ERC-4626 vault. Exactly one of
        `amount` or `raw_amount` must be provided.
      title: EarnWithdrawRequestBody
      example:
        vault_id: cm7oxq1el000e11o8iwp7d0d0
        amount: '1.5'
      x-stainless-model: wallets.actions.earn_withdraw_request_body
    EarnWithdrawActionResponse:
      type: object
      properties:
        id:
          type: string
          description: The ID of the wallet action.
        status:
          allOf:
            - $ref: '#/components/schemas/WalletActionStatus'
            - description: The current status of the wallet action.
        wallet_id:
          type: string
          description: The ID of the wallet involved in the action.
        created_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the wallet action was created.
        failure_reason:
          allOf:
            - $ref: '#/components/schemas/FailureReason'
            - description: >-
                Top-level failure context for the wallet action. Present on
                rejected or failed actions when available.
        steps:
          type: array
          items:
            $ref: '#/components/schemas/WalletActionStep'
          description: >-
            The steps of the wallet action. Only returned if `?include=steps` is
            provided.
        type:
          type: string
          enum:
            - earn_withdraw
        caip2:
          type: string
          description: CAIP-2 chain identifier.
        vault_id:
          type: string
          description: The vault ID.
        vault_address:
          type: string
          description: ERC-4626 vault contract address.
        asset:
          type: string
          description: >-
            Asset identifier (e.g. "usdc", "eth"). Only present when the token
            is known in the asset registry.
        asset_address:
          type: string
          description: Underlying asset token address.
        decimals:
          type: integer
          description: >-
            Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for
            ETH). Only present when the token is known in the asset registry.
        amount:
          type: string
          description: >-
            Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only
            present when the token is known in the asset registry.
        raw_amount:
          type: string
          description: Base-unit amount of asset withdrawn (e.g. "1500000").
        share_amount:
          type:
            - string
            - 'null'
          description: >-
            Vault shares burned in base units. Populated after on-chain
            confirmation.
      required:
        - id
        - status
        - wallet_id
        - created_at
        - type
        - caip2
        - vault_id
        - vault_address
        - asset_address
        - raw_amount
        - share_amount
      description: Response for an earn withdraw action.
      title: EarnWithdrawActionResponse
      x-stainless-model: wallets.actions.earn_withdraw_action_response
    WalletActionStatus:
      type: string
      enum:
        - pending
        - succeeded
        - rejected
        - failed
      description: Status of a wallet action.
      title: WalletActionStatus
      x-stainless-model: wallets.actions.wallet_action_status
    FailureReason:
      type: object
      properties:
        message:
          type: string
          description: Human-readable failure message.
        details:
          description: Additional error details, if available.
          x-stainless-any: true
      required:
        - message
      description: >-
        A description of why a wallet action (or a step within a wallet action)
        failed.
      title: FailureReason
      x-stainless-model: wallets.actions.failure_reason
    WalletActionStep:
      oneOf:
        - $ref: '#/components/schemas/EVMTransactionWalletActionStep'
        - $ref: '#/components/schemas/EVMUserOperationWalletActionStep'
        - $ref: '#/components/schemas/SVMTransactionWalletActionStep'
        - $ref: '#/components/schemas/TVMTransactionWalletActionStep'
        - $ref: '#/components/schemas/ExternalTransactionWalletActionStep'
        - $ref: '#/components/schemas/CustodianTransactionWalletActionStep'
      discriminator:
        propertyName: type
        mapping:
          evm_transaction:
            $ref: '#/components/schemas/EVMTransactionWalletActionStep'
          evm_user_operation:
            $ref: '#/components/schemas/EVMUserOperationWalletActionStep'
          svm_transaction:
            $ref: '#/components/schemas/SVMTransactionWalletActionStep'
          tvm_transaction:
            $ref: '#/components/schemas/TVMTransactionWalletActionStep'
          external_transaction:
            $ref: '#/components/schemas/ExternalTransactionWalletActionStep'
          custodian_transaction:
            $ref: '#/components/schemas/CustodianTransactionWalletActionStep'
      description: A step within a wallet action, representing a single onchain action.
      title: WalletActionStep
      x-stainless-model: wallets.actions.wallet_action_step
    EVMTransactionWalletActionStep:
      type: object
      properties:
        type:
          type: string
          enum:
            - evm_transaction
        failure_reason:
          $ref: '#/components/schemas/FailureReason'
        finalized:
          type: boolean
          description: >-
            Whether this step has reached on-chain finality. Absent until
            finality is confirmed.
        status:
          allOf:
            - $ref: '#/components/schemas/EVMWalletActionStepStatus'
            - description: EVM transaction status.
        caip2:
          type: string
          description: CAIP-2 chain identifier of the transaction, containing the chain ID.
        transaction_hash:
          type:
            - string
            - 'null'
          description: >-
            The transaction hash for this step. May change while the step status
            is non-terminal.
      required:
        - type
        - status
        - caip2
        - transaction_hash
      description: A wallet action step consisting of an EVM transaction.
      title: EVMTransactionWalletActionStep
      x-stainless-model: wallets.actions.evm_transaction_wallet_action_step
    EVMUserOperationWalletActionStep:
      type: object
      properties:
        type:
          type: string
          enum:
            - evm_user_operation
        failure_reason:
          $ref: '#/components/schemas/FailureReason'
        finalized:
          type: boolean
          description: >-
            Whether this step has reached on-chain finality. Absent until
            finality is confirmed.
        gas_credits_charged_usd:
          type: string
          description: Amount charged in USD for gas sponsorship on this step.
        status:
          allOf:
            - $ref: '#/components/schemas/EVMWalletActionStepStatus'
            - description: User operation status.
        user_operation_hash:
          type:
            - string
            - 'null'
          description: >-
            The user operation hash for this step. May change while the step
            status is non-terminal.
        bundle_transaction_hash:
          type:
            - string
            - 'null'
          description: >-
            Transaction hash of the bundle in which this user operation was
            included. Null until included by a bundler.
        caip2:
          type: string
          description: >-
            CAIP-2 network identifier, containing the chain ID of the user
            operation.
        entrypoint_version:
          allOf:
            - $ref: '#/components/schemas/EVMUserOperationEntrypointVersion'
            - description: The entrypoint version of the user operation.
      required:
        - type
        - status
        - user_operation_hash
        - bundle_transaction_hash
        - caip2
        - entrypoint_version
      description: A wallet action step consisting of an EVM user operation.
      title: EVMUserOperationWalletActionStep
      x-stainless-model: wallets.actions.evm_user_operation_wallet_action_step
    SVMTransactionWalletActionStep:
      type: object
      properties:
        type:
          type: string
          enum:
            - svm_transaction
        failure_reason:
          $ref: '#/components/schemas/FailureReason'
        finalized:
          type: boolean
          description: >-
            Whether this step has reached on-chain finality. Absent until
            finality is confirmed.
        gas_credits_charged_usd:
          type: string
          description: Amount charged in USD for gas sponsorship on this step.
        status:
          allOf:
            - $ref: '#/components/schemas/SVMWalletActionStepStatus'
            - description: SVM transaction status.
        caip2:
          type: string
          description: CAIP-2 chain identifier for the Solana network.
        transaction_signature:
          type:
            - string
            - 'null'
          description: >-
            The Solana transaction signature (base58-encoded). Null until
            broadcast.
      required:
        - type
        - status
        - caip2
        - transaction_signature
      description: A wallet action step consisting of an SVM (Solana) transaction.
      title: SVMTransactionWalletActionStep
      x-stainless-model: wallets.actions.svm_transaction_wallet_action_step
    TVMTransactionWalletActionStep:
      type: object
      properties:
        type:
          type: string
          enum:
            - tvm_transaction
        failure_reason:
          $ref: '#/components/schemas/FailureReason'
        status:
          allOf:
            - $ref: '#/components/schemas/TVMWalletActionStepStatus'
            - description: TVM transaction status.
        caip2:
          type: string
          description: CAIP-2 chain identifier for the Tron network.
        transaction_id:
          type:
            - string
            - 'null'
          description: The Tron transaction ID. Null until broadcast.
      required:
        - type
        - status
        - caip2
        - transaction_id
      description: A wallet action step consisting of a TVM (Tron) transaction.
      title: TVMTransactionWalletActionStep
      x-stainless-model: wallets.actions.tvm_transaction_wallet_action_step
    ExternalTransactionWalletActionStep:
      type: object
      properties:
        type:
          type: string
          enum:
            - external_transaction
        failure_reason:
          $ref: '#/components/schemas/FailureReason'
        status:
          allOf:
            - $ref: '#/components/schemas/ExternalTransactionWalletActionStepStatus'
            - description: External transaction step status.
      required:
        - type
        - status
      description: >-
        A wallet action step representing a cross-chain/cross-asset fill by an
        external provider.
      title: ExternalTransactionWalletActionStep
      x-stainless-model: wallets.actions.external_transaction_wallet_action_step
    CustodianTransactionWalletActionStep:
      type: object
      properties:
        type:
          type: string
          enum:
            - custodian_transaction
        failure_reason:
          $ref: '#/components/schemas/FailureReason'
        status:
          allOf:
            - $ref: '#/components/schemas/CustodianTransactionWalletActionStepStatus'
            - description: Custodian transaction step status.
        custodian:
          type: string
          description: >-
            Identifier of the custodian executing this transaction (e.g.
            "bridge").
      required:
        - type
        - status
        - custodian
      description: >-
        A wallet action step representing a transaction executed by a custodian
        (e.g. Bridge).
      title: CustodianTransactionWalletActionStep
      x-stainless-model: wallets.actions.custodian_transaction_wallet_action_step
    EVMWalletActionStepStatus:
      type: string
      enum:
        - preparing
        - queued
        - pending
        - retrying
        - confirmed
        - rejected
        - reverted
        - replaced
        - abandoned
      description: Status of an EVM step in a wallet action.
      title: EVMWalletActionStepStatus
      x-stainless-model: wallets.actions.evm_wallet_action_step_status
    EVMUserOperationEntrypointVersion:
      type: string
      enum:
        - '0.6'
        - '0.7'
        - '0.8'
        - '0.9'
      description: The ERC-4337 entrypoint contract version used by the user operation.
      title: EVMUserOperationEntrypointVersion
      x-stainless-model: wallets.actions.evm_user_operation_entrypoint_version
    SVMWalletActionStepStatus:
      type: string
      enum:
        - preparing
        - queued
        - pending
        - confirmed
        - rejected
        - reverted
        - failed
      description: Status of an SVM step in a wallet action.
      title: SVMWalletActionStepStatus
      x-stainless-model: wallets.actions.svm_wallet_action_step_status
    TVMWalletActionStepStatus:
      type: string
      enum:
        - preparing
        - queued
        - pending
        - confirmed
        - rejected
        - reverted
        - failed
      description: Status of a TVM (Tron) step in a wallet action.
      title: TVMWalletActionStepStatus
      x-stainless-model: wallets.actions.tvm_wallet_action_step_status
    ExternalTransactionWalletActionStepStatus:
      type: string
      enum:
        - preparing
        - queued
        - pending
        - confirmed
        - rejected
        - failed
      description: Status of an external transaction step in a wallet action.
      title: ExternalTransactionWalletActionStepStatus
      x-stainless-model: wallets.actions.external_transaction_wallet_action_step_status
    CustodianTransactionWalletActionStepStatus:
      type: string
      enum:
        - preparing
        - queued
        - custodian_reviewing
        - pending
        - confirmed
        - rejected
        - failed
      description: Status of a custodian transaction step in a wallet action.
      title: CustodianTransactionWalletActionStepStatus
      x-stainless-model: wallets.actions.custodian_transaction_wallet_action_step_status
  securitySchemes:
    appSecretAuth:
      type: http
      scheme: basic
      description: >-
        Basic Auth header with your app ID as the username and your app secret
        as the password.

````