# Withdrawals

1. [Deactivate API](#deactivate-request)\
   Returns an unsigned transaction to begin unstaking a stake account.
2. [Withdraw API](#withdraw)\
   Returns an unsigned transaction to withdraw SOL from a fully deactivated stake account.

## API Reference

* [Deactivate Request](#deactivate-request)
  * [Sample Request](#sample-request)
  * [Types](#types)
    * [Deactivate Response Object](#deactivate-response-object)
* [Balance Request](#balance)
  * [Sample Request](#sample-request-1)
    * [Withdraw Response Object](#withdraw-response-object)

## Deactivate Request

<mark style="color:green;">`POST`</mark> `/api/v1/deactivate`

Submits a deactivate request to generate an unsigned transaction. This transaction needs to be signed by the private key of the wallet address and broadcasted to the network to trigger deactivation of stake accounts<br>

#### Headers

| Name                                      | Type   | Description                   |
| ----------------------------------------- | ------ | ----------------------------- |
| api-key<mark style="color:red;">\*</mark> | String | API Key provided by Luganodes |

#### Request Body

| Name                                                 | Type   | Description                          |
| ---------------------------------------------------- | ------ | ------------------------------------ |
| validatorPubKey<mark style="color:red;">\*</mark>    | String | Public address of validator          |
| walletPubKey<mark style="color:red;">\*</mark>       | String | Wallet address                       |
| stakeAccountPubKey<mark style="color:red;">\*</mark> | String | Public address of user stake account |

{% tabs %}
{% tab title="200: OK Deactivate Response Object" %}

```json
{
    "success": true,
    "data": {
        "validatorPubkey": "6aow5rTURdbhbeMDrFrbP2GR5vZjMEhktEy87iH1VGPs",
        "walletPubkey": "2WeFEJbeXFrfm9v7zgF25bViroaHgLxX7imeMyLFzeBA",
        "stakeAccountPubkey": "BW8yWJoNPBQfKLLN2oKh7FxQEGimXFDHfDgrADPxRnxj",
        "unsignedTransactionBase64": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAIEFnOk0ZOXCCj0mVHqGUp7F+D7DTliS46FUE+sAeVtrimcC7qt7Ed4l19FBITNtyX3HgJdOsjOMrkh6iZyDoFqZAah2BeRN1QqmDQ3vf4qerJVf1NcinhyK2ikncAAAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAB11L4Dvg0YoB4hY0KwaHv2zg0IZTtyyyvi/yugS1UUQAECAwEDAAQFAAAA"
    }
}
```

{% endtab %}
{% endtabs %}

#### **Sample Request**

```bash
curl --location '{{url}}/v1/stake' \
--header 'api-key: ee908371-d13b-43dd-ae33-b854dade5e9d' \
--data '{
    "validatorPubkey": "6aow5rTURdbhbeMDrFrbP2GR5vZjMEhktEy87iH1VGPs",
    "walletPubkey": "2WeFEJbeXFrfm9v7zgF25bViroaHgLxX7imeMyLFzeBA",
    "stakeAccountPubkey": "BW8yWJoNPBQfKLLN2oKh7FxQEGimXFDHfDgrADPxRnxj"
}'
```

#### **Types**

#### Deactivate Response Object

<table><thead><tr><th width="216.13020833333331">Property</th><th width="469">Description</th><th>Type</th></tr></thead><tbody><tr><td>validatorPubKey</td><td>Public address of validator  </td><td>String</td></tr><tr><td>walletPubKey</td><td>Public address of user wallet</td><td>String</td></tr><tr><td>stakeAccountPubKey</td><td>Public address of stake account </td><td>String</td></tr><tr><td>unsignedTransactionBase64</td><td>Unsigned transaction which needs to be signed with the private key of the user wallet</td><td>String</td></tr></tbody></table>

## Withdraw&#x20;

<mark style="color:green;">`POST`</mark> `/api/v1/withdraw`

Submits a withdraw request to generate an unsigned transaction. This transaction needs to be signed by the private key of the wallet address and broadcasted to the network to trigger withdrawal of delegated SOL.<br>

#### Headers

| Name                                      | Type   | Description                   |
| ----------------------------------------- | ------ | ----------------------------- |
| api-key<mark style="color:red;">\*</mark> | String | API Key provided by Luganodes |

#### Request Body

| Name                                                 | Type   | Description                                                      |
| ---------------------------------------------------- | ------ | ---------------------------------------------------------------- |
| validatorPubKey<mark style="color:red;">\*</mark>    | String | Public address of validator                                      |
| walletPubKey<mark style="color:red;">\*</mark>       | String | Wallet address                                                   |
| stakeAccountPubKey<mark style="color:red;">\*</mark> | String | Public address of user stake account                             |
| amount<mark style="color:red;">\*</mark>             | Number | <p>SOL to withdraw in lamports.<br><br>1 SOL = 10^9 Lamports</p> |

{% tabs %}
{% tab title="200: OK Withdraw Response Object" %}

```json
{
    "success": true,
    "data": {
        "validatorPubkey": "6aow5rTURdbhbeMDrFrbP2GR5vZjMEhktEy87iH1VGPs",
        "walletPubkey": "2WeFEJbeXFrfm9v7zgF25bViroaHgLxX7imeMyLFzeBA",
        "stakeAccountPubkey": "BW8yWJoNPBQfKLLN2oKh7FxQEGimXFDHfDgrADPxRnxj",
        "amount": 1,
        "unsignedTransactionBase64": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAIEFnOk0ZOXCCj0mVHqGUp7F+D7DTliS46FUE+sAeVtrimcC7qt7Ed4l19FBITNtyX3HgJdOsjOMrkh6iZyDoFqZAah2BeRN1QqmDQ3vf4qerJVf1NcinhyK2ikncAAAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAB11L4Dvg0YoB4hY0KwaHv2zg0IZTtyyyvi/yugS1UUQAECAwEDAAQFAAAA"
    }
}
```

{% endtab %}
{% endtabs %}

#### **Sample Request**

```bash
curl --location '{{url}}/v1/withdraw' \
--header 'api-key: ee908371-d13b-43dd-ae33-b854dade5e9d' \
--data '{
    "validatorPubkey": "6aow5rTURdbhbeMDrFrbP2GR5vZjMEhktEy87iH1VGPs",
    "walletPubkey": "2WeFEJbeXFrfm9v7zgF25bViroaHgLxX7imeMyLFzeBA",
    "stakeAccountPubkey": "BW8yWJoNPBQfKLLN2oKh7FxQEGimXFDHfDgrADPxRnxj"
    "amount": 1
}'
```

#### **Types**

#### Withdraw Response Object

<table><thead><tr><th width="216.13020833333331">Property</th><th width="469">Description</th><th>Type</th></tr></thead><tbody><tr><td>validatorPubKey</td><td>Public address of validator  </td><td>String</td></tr><tr><td>walletPubKey</td><td>Public address of user wallet</td><td>String</td></tr><tr><td>stakeAccountPubKey</td><td>Public address of stake account </td><td>String</td></tr><tr><td>unsignedTransactionBase64</td><td>Unsigned transaction which needs to be signed with the private key of the user wallet</td><td>String</td></tr><tr><td>amount</td><td>Amount to be withdrawn in lamports<br><br>1 SOL = 10^9 Lamports</td><td>Number</td></tr></tbody></table>


---

# Agent Instructions: 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:

```
GET https://docs.luganodes.com/apis/staking-apis-v2/solana/withdrawals.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
