# Sweep

The sweep endpoint facilitates the seamless transfer of all BSV and STAS tokens associated with a specific private key string to a designated address. A notable feature of this endpoint is its compatibility with QR codes incorporating a private key in Wallet Import Format (WIF), offering users a quick and easy method to interact with web pages or participate in live events. Essentially, this functionality can be leveraged to create a "scan and go" system, enhancing the user experience by simplifying transactions and promoting engagement in various digital environments. Moreover, the application of QR codes can foster secure and instantaneous transactions, thereby bringing a dynamic and interactive dimension to the user's journey.\
\
Body Request

```javascript
{
 privateKey : "string"
}
```

## Transfer all assets from PrivateKey to the user

<mark style="color:green;">`POST`</mark> `https://api.relysia.com/v1/sweep`

The sweep endpoints allows users to transfer all coins (BSV and Tokens) from a PrivateKey.

#### Headers

| Name     | Type   | Description                                                   |
| -------- | ------ | ------------------------------------------------------------- |
| walletId | String | User wallet Id. Will use default wallet if no value provided. |

#### Request Body

| Name                                         | Type   | Description                                    |
| -------------------------------------------- | ------ | ---------------------------------------------- |
| privateKey<mark style="color:red;">\*</mark> | String | Private Key string to transfer all asset from. |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "operation completed successfully",
    "txIds": [
      "02f60500a9163ad7af8fa619633fd3d1798daff4159fd4079cb9aab8ec88fe6e",
      "b85a0ba09d65952e78aadca40d99e619e82beff05446ed4c901bcdd30e441b20",
      "00f7c5552da20ba707bafb8a9cc9f83e7b06b550e3fbf575b7b822e8afa20a7d"
    ],
    "errors": []
  }
}
```

{% endtab %}
{% endtabs %}


---

# 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.relysia.com/payments/sweep.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.
