> For the complete documentation index, see [llms.txt](https://docs.xpay.stream/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xpay.stream/wallets/update-wallet.md).

# Update Wallet

{% hint style="info" %}
**API Endpoint**

**POST** [**/client/wallets/save**](https://xpay.stream/client/wallets/save)
{% endhint %}

***

{% hint style="info" %}
**Request Headers:**

Authorization: Bearer [\<access\_token>](/authentication-api.md)

Content-Type: application/json\
\
**Request Body:**

{% code lineNumbers="true" %}

```json
{
    "wallet":"<existing_wallet_uuid>",
    "tag" : "<your_new_tag>"
}
```

{% endcode %}
{% endhint %}

{% hint style="success" %}
**Success Response**

{% code lineNumbers="true" fullWidth="true" %}

```json
{
    "success": {
        "message": "Wallet Saved",
        "data": {
            "uuid": "<wallet_uuid>",
            "tag": "<your_new_tag>"
        }
    },
    "uuid": "597edb5b-9e6a-4cd2-a5c5-9cce5d0a2efb"
}
```

{% endcode %}
{% endhint %}

***

{% tabs %}
{% tab title="CURL Example" %}
{% code lineNumbers="true" fullWidth="true" %}

```bash
curl 'https://apis.xpay.stream/client/wallets/save'    \
  -H 'Content-Type: application/json'                  \
  -H 'Authorization: Bearer <access_token>'            \
  --data-raw '{"wallet":"<uuid>","tag":"<tag>"}'              
```

{% endcode %}
{% endtab %}

{% tab title="NodeJS Example" %}
{% code lineNumbers="true" %}

```javascript
// npm i cross-fetch
const fetch = require("cross-fetch");

const API_URL = "https://apis.xpay.stream/client/wallets/save";

const method = "POST";

const headers = { 
    "Content-Type": "application/json",
    "Authorization": "Bearer <access_token>"
};

const body = JSON.stringify({
    wallet: "<existing_wallet_uuid>", 
    tag: "<your_tag>"
});

fetch(API_URL, { headers, body, method })
.then(async res =>  await res.json())
.then(result => {
    if(result.error)
        console.log("Wallet Update Error", result);
    if(result.success)
        console.log("Wallet Updated", result);
})
.catch((err) => {
    console.error("Wallet Update API Exception", err);
});
```

{% endcode %}

{% endtab %}
{% endtabs %}


---

# 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.xpay.stream/wallets/update-wallet.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.
