Requires an API key via the
X-API-Key header. See API Keys. Overview
POST /v2/actions/withdraw/{opportunityId}
The withdraw endpoint generates transactions to redeem shares from a vault/opportunity. The typical flow is:
1
Create withdraw action
Call the endpoint to generate the transactions.
2
Sign & submit transactions
The user signs and submits each transaction in order (e.g., approve + withdraw). No further action needed.
Create Withdraw
Generate the transactions needed to withdraw from an opportunity. The response contains an ordered list of transactions the user must sign and submit (e.g., approve + withdraw).The unique identifier of the opportunity to withdraw from. Get this from the Opportunities API.
The user’s EVM wallet address. Any valid address works; the wallet needs no Turtle account. A sanctioned wallet is rejected (see Error Handling).
The address of the token to receive after withdrawal. Required for some providers (e.g., Midas, Mellow, Veda). If not provided, the vault’s default withdraw token is used.
Slippage tolerance in basis points. For example,
50 = 0.5% slippage. Only applied to opportunities that require it.Transaction Object
Each transaction in thetransactions array contains:
Optional metadata for swap transactions, including provider info, amount out, gas estimate, and route details.
Complete Example
Here’s a full withdraw flow from start to finish:Operational Notes
Submit transactions in order
Submit transactions in order
The
transactions array is ordered. A withdrawal typically returns an approve then a withdraw. Confirm each before broadcasting the next.tokenOut is required for some providers
tokenOut is required for some providers
tokenOut sets the token the user receives. It is required for some providers (e.g., Midas, Mellow, Veda). If not provided, the vault’s default withdraw token is used.slippageBps applies where required
slippageBps applies where required
slippageBps is the slippage tolerance in basis points (50 = 0.5%). It is only applied to opportunities that require it.Error Handling
Wallet is sanctioned
Wallet is sanctioned
Status Code: 403 ForbiddenThe API screens
userAddress against the OFAC sanctions list on every request and builds no transactions for a sanctioned wallet.Solution: Do not retry with this wallet.Invalid wallet address
Invalid wallet address
Status Code: 400 Bad RequestSolution: Pass a valid EVM address as
userAddress.Distributor not found
Distributor not found
Status Code: 404 Not FoundSolution: Verify your distributor ID is correct and active.
Opportunity not found
Opportunity not found
Invalid tokenOut address
Invalid tokenOut address
Status Code: 400 Bad RequestSolution: Provide a valid EVM address for the
tokenOut field.Related Endpoints
- Deposit - Generate deposit transactions
- Get Opportunities - Discover available opportunities and their IDs

