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

# Recover assets from a master wallet

> Recover native tokens or ERC-20 tokens from a master wallet using its stored private key.
This is useful for recovering funds from master wallets that may have been compromised or
when you need to consolidate funds to a different wallet.




## OpenAPI

````yaml /api-reference/openapi.json post /v1/master-wallets/{masterId}/recover
openapi: 3.0.3
info:
  title: XentFi API
  version: 1.0.0
  description: >-
    API documentation for XentFi.The XentFi API gives you access to pretty much
    all the features you can use on our dashboard and lets you extend them for
    use in your application. It strives to be RESTful and is organized around
    the main resources you would be interacting with - with a few notable
    exceptions.
servers:
  - url: https://api.xentfi.com
    description: Development server
security: []
tags: []
paths:
  /v1/master-wallets/{masterId}/recover:
    post:
      tags:
        - Master Wallets
        - Asset Recovery
      summary: Recover assets from a master wallet
      description: >
        Recover native tokens or ERC-20 tokens from a master wallet using its
        stored private key.

        This is useful for recovering funds from master wallets that may have
        been compromised or

        when you need to consolidate funds to a different wallet.
      operationId: recoverAssetsFromMaster
      parameters:
        - name: masterId
          in: path
          required: true
          schema:
            type: string
          description: ID of the master wallet to recover assets from
          example: master_123456789
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - recipientAddress
                - amount
              properties:
                recipientAddress:
                  type: string
                  description: Address to send the recovered assets to
                  example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0b5b5'
                amount:
                  type: string
                  description: Amount to recover (in human-readable format)
                  example: '1.5'
                tokenAddress:
                  type: string
                  description: Token contract address (omit for native token recovery)
                  example: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
                  nullable: true
                rpcUrl:
                  type: string
                  description: Custom RPC URL for the blockchain (optional)
                  example: https://eth-mainnet.g.alchemy.com/v2/your-key
                  nullable: true
                isL2:
                  type: boolean
                  description: Set to true if recovering from a Layer 2 blockchain
                  default: false
                  example: false
                crossNetwork:
                  type: boolean
                  description: >-
                    Set to true to recover assets sent to wrong network (e.g.,
                    mainnet assets on testnet address)
                  default: false
                  example: false
      responses:
        '200':
          description: Assets recovered successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      success:
                        type: boolean
                        description: Whether the recovery was successful
                        example: true
                      txHash:
                        type: string
                        description: Transaction hash of the recovery transaction
                        example: >-
                          0x28a1bfa727a024dd450352e736f957ac6f08471825362130ef1c3b4da536ebfb
                      blockchain:
                        type: string
                        description: Blockchain network used for recovery
                        enum:
                          - EVM
                          - Solana
                          - Bitcoin
                        example: EVM
                      amount:
                        type: string
                        description: Amount recovered
                        example: '1.5'
                      token:
                        type: string
                        description: Token symbol or type recovered
                        example: USDC
                        nullable: true
                      fee:
                        type: string
                        description: Transaction fee paid (in native token)
                        example: '0.00021'
                      message:
                        type: string
                        description: Additional recovery message
                        example: Assets recovered successfully
                        nullable: true
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: NOT_FOUND
                      message:
                        type: string
                        example: Wallet not found
                      timestamp:
                        type: string
                        format: date-time
                      requestId:
                        type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: NOT_FOUND
                      message:
                        type: string
                        example: Wallet not found
                      timestamp:
                        type: string
                        format: date-time
                      requestId:
                        type: string
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: NOT_FOUND
                      message:
                        type: string
                        example: Wallet not found
                      timestamp:
                        type: string
                        format: date-time
                      requestId:
                        type: string
        '404':
          description: Master wallet not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: NOT_FOUND
                      message:
                        type: string
                        example: Wallet not found
                      timestamp:
                        type: string
                        format: date-time
                      requestId:
                        type: string
      security:
        - ApiKeyAuth: []
          OrgIdAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apiKey
    OrgIdAuth:
      type: apiKey
      in: header
      name: orgId

````