Skip to main content
POST
https://api.heyvincent.ai
/
user
/
{appId}
/
request-withdraw
curl -X POST https://api.heyvincent.ai/user/123/request-withdraw \
  -H "Content-Type: application/json" \
  -d '{
    "userControllerAddress": "0xUserWalletAddress...",
    "assets": [
      {
        "network": "base-mainnet",
        "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "amount": 100
      }
    ]
  }'
{
  "withdrawals": [
    {
      "network": "base-mainnet",
      "userOp": {
        "sender": "0xAgentSmartAccountAddress...",
        "nonce": "0x1",
        "callData": "0xa9059cbb...",
        "callGasLimit": "0x5208",
        "verificationGasLimit": "0x10000",
        "preVerificationGas": "0x5208",
        "maxFeePerGas": "0x3b9aca00",
        "maxPriorityFeePerGas": "0x3b9aca00",
        "paymaster": "0xPaymasterAddress...",
        "paymasterData": "0x..."
      },
      "userOpHash": "0x1234567890abcdef..."
    }
  ]
}
After checking available balances with agent-funds, use this endpoint to initiate a withdrawal of tokens from the user’s agent smart account back to their controller wallet. This endpoint prepares unsigned UserOperations that the user must sign to authorize the withdrawal.
This is the first step in a two-step withdrawal process. After receiving the unsigned UserOperations, the user must sign them and submit to complete-withdraw to execute the transfers.

Request

appId
integer
required
The unique identifier of the app
userControllerAddress
string
required
The Ethereum address of the user’s wallet (recipient of withdrawn funds)
assets
array
required
List of assets to withdraw from the agent account

Response

withdrawals
array
List of unsigned UserOperations, one per network
errors
array
List of errors for networks that failed to prepare (only present if some networks failed)
curl -X POST https://api.heyvincent.ai/user/123/request-withdraw \
  -H "Content-Type: application/json" \
  -d '{
    "userControllerAddress": "0xUserWalletAddress...",
    "assets": [
      {
        "network": "base-mainnet",
        "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "amount": 100
      }
    ]
  }'
{
  "withdrawals": [
    {
      "network": "base-mainnet",
      "userOp": {
        "sender": "0xAgentSmartAccountAddress...",
        "nonce": "0x1",
        "callData": "0xa9059cbb...",
        "callGasLimit": "0x5208",
        "verificationGasLimit": "0x10000",
        "preVerificationGas": "0x5208",
        "maxFeePerGas": "0x3b9aca00",
        "maxPriorityFeePerGas": "0x3b9aca00",
        "paymaster": "0xPaymasterAddress...",
        "paymasterData": "0x..."
      },
      "userOpHash": "0x1234567890abcdef..."
    }
  ]
}