curl --request POST \
--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "withdraw",
"network": "MAINNET",
"params": {
"onchain_address": "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4",
"exit_speed": "FAST",
"amount_sats": 10000,
"fee_quote_id": "5c1a...",
"fee_amount_sats": 250,
"deduct_fee_from_withdrawal_amount": false
}
}'
{
"method": "withdraw",
"data": {
"id": "9b1f8a2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
"created_at": "2025-07-24T16:43:12.509Z",
"updated_at": "2025-07-24T16:43:12.509Z",
"network": "MAINNET",
"fee": {
"original_value": 200,
"original_unit": "SATOSHI"
},
"l1_broadcast_fee": {
"original_value": 50,
"original_unit": "SATOSHI"
},
"status": "PENDING",
"expires_at": "2025-07-24T17:43:12.509Z",
"coop_exit_txid": "448f305caf15ec10b2a8286fde6c31ebe2eb30e2018b22a8f7630d3fa2753e49",
"fee_quote_id": "5c1a...",
"exit_speed": "FAST"
}
}
Spark BTC
withdraw
Withdraw BTC from a Spark wallet to a Bitcoin L1 address (cooperative exit).
POST
/
v1
/
wallets
/
{wallet_id}
/
rpc
curl --request POST \
--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "withdraw",
"network": "MAINNET",
"params": {
"onchain_address": "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4",
"exit_speed": "FAST",
"amount_sats": 10000,
"fee_quote_id": "5c1a...",
"fee_amount_sats": 250,
"deduct_fee_from_withdrawal_amount": false
}
}'
{
"method": "withdraw",
"data": {
"id": "9b1f8a2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
"created_at": "2025-07-24T16:43:12.509Z",
"updated_at": "2025-07-24T16:43:12.509Z",
"network": "MAINNET",
"fee": {
"original_value": 200,
"original_unit": "SATOSHI"
},
"l1_broadcast_fee": {
"original_value": 50,
"original_unit": "SATOSHI"
},
"status": "PENDING",
"expires_at": "2025-07-24T17:43:12.509Z",
"coop_exit_txid": "448f305caf15ec10b2a8286fde6c31ebe2eb30e2018b22a8f7630d3fa2753e49",
"fee_quote_id": "5c1a...",
"exit_speed": "FAST"
}
}
Idempotency on errors: On 4xx or 5xx, Privy caches the response and replays it for the same
key. Generate a new key to retry after a server error. Policy violations are an exception and
allow same-key retries.
curl --request POST \
--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "withdraw",
"network": "MAINNET",
"params": {
"onchain_address": "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4",
"exit_speed": "FAST",
"amount_sats": 10000,
"fee_quote_id": "5c1a...",
"fee_amount_sats": 250,
"deduct_fee_from_withdrawal_amount": false
}
}'
{
"method": "withdraw",
"data": {
"id": "9b1f8a2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
"created_at": "2025-07-24T16:43:12.509Z",
"updated_at": "2025-07-24T16:43:12.509Z",
"network": "MAINNET",
"fee": {
"original_value": 200,
"original_unit": "SATOSHI"
},
"l1_broadcast_fee": {
"original_value": 50,
"original_unit": "SATOSHI"
},
"status": "PENDING",
"expires_at": "2025-07-24T17:43:12.509Z",
"coop_exit_txid": "448f305caf15ec10b2a8286fde6c31ebe2eb30e2018b22a8f7630d3fa2753e49",
"fee_quote_id": "5c1a...",
"exit_speed": "FAST"
}
}
Headers
string
required
ID of your Privy app.
string
Request authorization signature. If multiple signatures are required, they should be comma
separated.
string
Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the
request must be processed.
Path Parameters
string
required
ID of the wallet to get.
These wallet methods are modeled after the Spark Wallet
SDK. For more
information about this wallet method, check out the Spark Wallet
documentation.
Body
string
required
Must be set to
withdraw.string
required
Blockchain network to use. Options:
MAINNET, REGTEST.object
required
Hide child attributes
Hide child attributes
string
required
The Bitcoin L1 address to withdraw to.
enum<string>
required
The exit speed for the withdrawal. Options:
FAST, MEDIUM, SLOW.number
The amount of satoshis to withdraw. Withdraws the full balance if not specified.
number
The fee amount in satoshis, from a prior
getWithdrawalFeeQuote call.string
The fee quote ID from a prior
getWithdrawalFeeQuote call.boolean
Whether to deduct the fee from the withdrawal amount. Defaults to false.
Returns
enum<string>
required
Available options:
withdrawobject
required
A
CoopExitRequest object with the following fields:Hide child attributes
Hide child attributes
string
required
The unique identifier of this coop exit request.
string
required
The date and time when the request was first created.
string
required
The date and time when the request was last updated.
string
required
The network the coop exit request is on.
object
required
object
required
string
required
The status of this coop exit request.
string
required
The time when the coop exit request expires and the UTXOs are released.
string
required
The transaction id of the coop exit transaction.
string
The fee quote ID used for this coop exit.
enum<string>
The exit speed used for this coop exit. Options:
FAST, MEDIUM, SLOW.Was this page helpful?

