> For the complete documentation index, see [llms.txt](https://docs.gobtcpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gobtcpay.com/api-reference/wallet-api/multisig-withdrawal.md).

# Multisig Withdrawal

On-chain multisig withdrawal flow: fetch signing data, build a PSBT, and broadcast it once co-signed.

## Get withdrawal parameters

> Returns everything needed to build a withdrawal PSBT client-side: the multisig descriptor (\`m\`/\`n\`, witness script), spendable UTXOs, recommended fee rates (low / medium / high), change script details, and virtual-size parameters for fee estimation.

```json
{"openapi":"3.1.0","info":{"title":"GoBTC Pay Wallet API","version":"1.45.2"},"tags":[{"name":"Multisig Withdrawal","description":"On-chain multisig withdrawal flow: fetch signing data, build a PSBT, and broadcast it once co-signed."}],"servers":[{"url":"https://api.gobtcpay.com/public/api/v1.1"}],"security":[{"walletAuth":[]}],"components":{"securitySchemes":{"walletAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Wallet access token obtained from `/instant/auth/get-jwt` via the signature challenge flow. Send it as `Authorization: Bearer <accessToken>`. Refresh it via `/instant/auth/refresh-jwt` when it expires."}}},"paths":{"/multisig/onchain/get-data-to-withdraw":{"post":{"summary":"Get withdrawal parameters","description":"Returns everything needed to build a withdrawal PSBT client-side: the multisig descriptor (`m`/`n`, witness script), spendable UTXOs, recommended fee rates (low / medium / high), change script details, and virtual-size parameters for fee estimation.","tags":["Multisig Withdrawal"],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"object","properties":{"$case":{"type":"string","const":"success"},"success":{"type":"object","properties":{"multisig":{"type":"object","properties":{"m":{"type":"number","description":"Number of required signatures (the *m* in m-of-n multisig)."},"n":{"type":"number","description":"Total number of signers (the *n* in m-of-n multisig)."},"witnessScript":{"type":"string","description":"Witness script of the multisig wallet, hex-encoded."}},"required":["m","n","witnessScript"],"additionalProperties":false},"utxos":{"type":"array","items":{"type":"object","properties":{"txid":{"type":"string","description":"On-chain Bitcoin transaction id (hex)."},"vout":{"type":"number","description":"Index of the referenced output within its transaction."},"value":{"type":"number","description":"Output value, in satoshis."},"scriptPubKey":{"type":"string","description":"Output script (scriptPubKey), hex-encoded."}},"required":["txid","vout","value","scriptPubKey"],"additionalProperties":false},"description":"Spendable UTXOs of the wallet, for building the withdrawal client-side."},"feeRateSatVb":{"type":"object","properties":{"law":{"type":"number","description":"Low-priority fee rate (sat/vB)."},"medium":{"type":"number","description":"Medium-priority fee rate (sat/vB)."},"high":{"type":"number","description":"High-priority fee rate (sat/vB)."}},"required":["law","medium","high"],"additionalProperties":false,"description":"Fee rate in satoshis per virtual byte (sat/vB)."},"change":{"type":"object","properties":{"scriptPubKeyHex":{"type":"string","description":"Output script (scriptPubKey), hex-encoded."},"dustThreshold":{"type":"number","description":"Minimum output value in satoshis; change below this is treated as dust and dropped."}},"required":["scriptPubKeyHex","dustThreshold"],"additionalProperties":false},"params":{"type":"object","properties":{"vSizeP2wsh20f3In":{"type":"number","description":"Virtual size added per 2-of-3 P2WSH input, in vbytes."},"vSizeP2wpkhOut":{"type":"number","description":"Virtual size added per P2WPKH output, in vbytes."},"vSizeP2wshOut":{"type":"number","description":"Virtual size added per P2WSH output, in vbytes."},"txOverhead":{"type":"number","description":"Fixed transaction overhead, in vbytes."}},"required":["vSizeP2wsh20f3In","vSizeP2wpkhOut","vSizeP2wshOut","txOverhead"],"additionalProperties":false}},"required":["multisig","utxos","feeRateSatVb","change","params"],"additionalProperties":false}},"required":["$case","success"],"additionalProperties":false}},"required":["id","result"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"500":{"description":"Error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"statusCode":{"type":"number","description":"Numeric error status code."},"description":{"type":"string","description":"Human-readable description."},"statusMessage":{"type":"string","description":"Short machine-readable error message."}},"required":["statusCode","description","statusMessage"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}}}}}}}
```

## Build withdrawal transaction

> Builds an unsigned withdrawal PSBT to \`toAddress\`. Provide either \`amountSats\` or \`sendMax\`, plus a \`fee.feeRateSatVb\`. Optionally pin inputs with \`selectUtxos\` and enable replace-by-fee with \`rbf\`. Returns the \`jobId\`, \`psbtBase64\`, and a \`summary\` (fee, vsize, change, inputs). Co-sign, then submit via \*\*Broadcast withdrawal\*\*.

```json
{"openapi":"3.1.0","info":{"title":"GoBTC Pay Wallet API","version":"1.45.2"},"tags":[{"name":"Multisig Withdrawal","description":"On-chain multisig withdrawal flow: fetch signing data, build a PSBT, and broadcast it once co-signed."}],"servers":[{"url":"https://api.gobtcpay.com/public/api/v1.1"}],"security":[{"walletAuth":[]}],"components":{"securitySchemes":{"walletAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Wallet access token obtained from `/instant/auth/get-jwt` via the signature challenge flow. Send it as `Authorization: Bearer <accessToken>`. Refresh it via `/instant/auth/refresh-jwt` when it expires."}}},"paths":{"/multisig/onchain/build-psbt-to-withdraw":{"post":{"summary":"Build withdrawal transaction","description":"Builds an unsigned withdrawal PSBT to `toAddress`. Provide either `amountSats` or `sendMax`, plus a `fee.feeRateSatVb`. Optionally pin inputs with `selectUtxos` and enable replace-by-fee with `rbf`. Returns the `jobId`, `psbtBase64`, and a `summary` (fee, vsize, change, inputs). Co-sign, then submit via **Broadcast withdrawal**.","tags":["Multisig Withdrawal"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"toAddress":{"type":"string","description":"Destination Bitcoin address for the funds."},"amountSats":{"type":"number","description":"Amount in satoshis."},"sendMax":{"type":"boolean","description":"If true, sweeps the entire spendable balance to `toAddress` and ignores the amount."},"fee":{"type":"object","properties":{"feeRateSatVb":{"type":"number","exclusiveMinimum":0,"description":"Fee rate in satoshis per virtual byte (sat/vB)."}},"required":["feeRateSatVb"],"additionalProperties":false},"selectUtxos":{"type":"array","items":{"type":"object","properties":{"txid":{"type":"string","description":"On-chain Bitcoin transaction id (hex)."},"vout":{"type":"integer","minimum":0,"description":"Index of the referenced output within its transaction."}},"required":["txid","vout"],"additionalProperties":false},"description":"Optional list of specific UTXOs to spend. If omitted, coins are selected automatically."},"rbf":{"type":"boolean","description":"Enable Replace-By-Fee (BIP-125) so the transaction can be fee-bumped later."}},"required":["toAddress","fee"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"object","properties":{"$case":{"type":"string","const":"success"},"success":{"type":"object","properties":{"jobId":{"type":"string","description":"Id of this withdrawal build. Pass it with the co-signed PSBT to **Broadcast withdrawal**."},"psbtBase64":{"type":"string","description":"Unsigned transaction as a base64-encoded PSBT (BIP-174). Sign it with the wallet key."},"summary":{"type":"object","properties":{"toAddress":{"type":"string","description":"Destination Bitcoin address for the funds."},"amountSats":{"type":"number","description":"Amount in satoshis."},"feeSats":{"type":"number","description":"Network fee for the transaction, in satoshis."},"feeRateSatVb":{"type":"number","exclusiveMinimum":0,"description":"Fee rate in satoshis per virtual byte (sat/vB)."},"vsize":{"type":"integer","exclusiveMinimum":0,"description":"Estimated virtual size of the transaction, in vbytes."},"change":{"type":"object","properties":{"valueSats":{"type":"number","description":"Change output value, in satoshis."}},"required":["valueSats"],"additionalProperties":false},"inputs":{"type":"array","items":{"type":"object","properties":{"txid":{"type":"string","description":"On-chain Bitcoin transaction id (hex)."},"vout":{"type":"integer","minimum":0,"description":"Index of the referenced output within its transaction."},"value":{"type":"integer","exclusiveMinimum":0,"description":"Output value, in satoshis."}},"required":["txid","vout","value"],"additionalProperties":false}}},"required":["toAddress","amountSats","feeSats","feeRateSatVb","vsize","inputs"],"additionalProperties":false}},"required":["jobId","psbtBase64","summary"],"additionalProperties":false}},"required":["$case","success"],"additionalProperties":false}},"required":["id","result"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"500":{"description":"Error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"statusCode":{"type":"number","description":"Numeric error status code."},"description":{"type":"string","description":"Human-readable description."},"statusMessage":{"type":"string","description":"Short machine-readable error message."}},"required":["statusCode","description","statusMessage"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}}}}}}}
```

## Broadcast withdrawal

> Broadcasts a co-signed withdrawal. Submit the \`jobId\` from \*\*Build withdrawal PSBT\*\* and the \`signedPsbtBase64\`. Returns the broadcast \`txid\` (and \`txHex\` when available).

```json
{"openapi":"3.1.0","info":{"title":"GoBTC Pay Wallet API","version":"1.45.2"},"tags":[{"name":"Multisig Withdrawal","description":"On-chain multisig withdrawal flow: fetch signing data, build a PSBT, and broadcast it once co-signed."}],"servers":[{"url":"https://api.gobtcpay.com/public/api/v1.1"}],"security":[{"walletAuth":[]}],"components":{"securitySchemes":{"walletAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Wallet access token obtained from `/instant/auth/get-jwt` via the signature challenge flow. Send it as `Authorization: Bearer <accessToken>`. Refresh it via `/instant/auth/refresh-jwt` when it expires."}}},"paths":{"/multisig/onchain/confirm-withdraw":{"post":{"summary":"Broadcast withdrawal","description":"Broadcasts a co-signed withdrawal. Submit the `jobId` from **Build withdrawal PSBT** and the `signedPsbtBase64`. Returns the broadcast `txid` (and `txHex` when available).","tags":["Multisig Withdrawal"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string","description":"The `jobId` from **Build withdrawal transaction** (`/multisig/onchain/build-psbt-to-withdraw`)."},"signedPsbtBase64":{"type":"string","description":"The withdrawal PSBT, co-signed, base64-encoded."}},"required":["jobId","signedPsbtBase64"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"object","properties":{"$case":{"type":"string","const":"success"},"success":{"type":"object","properties":{"txid":{"type":"string","description":"On-chain Bitcoin transaction id (hex)."},"txHex":{"type":"string","description":"Raw signed transaction, hex-encoded (available once broadcast)."}},"required":["txid"],"additionalProperties":false}},"required":["$case","success"],"additionalProperties":false}},"required":["id","result"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"500":{"description":"Error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"statusCode":{"type":"number","description":"Numeric error status code."},"description":{"type":"string","description":"Human-readable description."},"statusMessage":{"type":"string","description":"Short machine-readable error message."}},"required":["statusCode","description","statusMessage"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gobtcpay.com/api-reference/wallet-api/multisig-withdrawal.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
