# Edit Wallet Name

## Edit a Wallet's Name

Edit a specific wallet's name in your organization according to a specific wallet ID.\
Please note that a wallet name can take up to 32 characters maximum.

```graphql
mutation UpdateWallet($where: WalletWhereUniqueInput!, $data: WalletUpdateInput!) {
  updateWallet(where: $where, data: $data) {
    id
    name
  }
}
```

### **Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

### **Body (**<mark style="color:orange;">WalletWhereUniqueInput</mark> object) + (<mark style="color:orange;">WalletUpdateInput</mark> object)

| Name                                         | Type   | Description       |
| -------------------------------------------- | ------ | ----------------- |
| walletId<mark style="color:red;">\*</mark>   | String | Wallet ID         |
| walletName<mark style="color:red;">\*</mark> | String | Wallet's New name |

Example body:

```json
{
  "where": {
    "id": "clllyfdk6006ybtqkwk840uei"
  },
  "data": {
    "name": "New Wallet Name"
  }
}
```

### Response

Return values:

| Name | Type   | Description         |
| ---- | ------ | ------------------- |
| id   | String | Wallet ID           |
| name | String | Updated Wallet Name |

{% tabs %}
{% tab title="🟢 Success" %}

```json
{
  "data": {
    "updateWallet": {
      "id": "clllyfdk6006ybtqkwk840uei",
      "name": "New Wallet Name"
    }
  }
}
```

{% endtab %}

{% tab title="🔴 Failure" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Using this endpoint users can edit any wallet's name within their organization wallets.
{% endhint %}

**How do I retrieve my wallet ID?**

In order to retrieve an organization's wallet ID, you'll need to call your organization wallets query first, to fetch the wallet's ID. The query below accepts a <mark style="color:orange;">**WalletWhereInput**</mark> of an `organizationId`, and retrieves the wallet's ID and name in the response.

```graphql
query Wallets($where: WalletWhereInput) {
  wallets(where: $where) {
    id
    name
  }
}
```

### Try it out!

{% embed url="<https://studio.apollographql.com/sandbox/explorer?endpoint=https://api.inabit.dev/graphql&explorerURLState=N4IgJg9gxgrgtgUwHYBcQC4RxighigSwiQAIBVABzHwQHVcAbBhFACgBIB3ACwQCcE6EvSYtavAWSQEAjjAQBJJBRwBCADQl21PEJHMUlHYuVqAlCWAAdPldIkYVGvpase-QVvcDNO3EO18XAtrW3sSEgIwGzsIiKRcRBj7AF9klJB1EAA3XD4CXAAjZgBnDBBQ2JIrEG8EGqFK8OqQKIaWqCYGAE8AMzAAawA2AAYRoe7ClBkBzgGADgAWEfkCGuSIlPUNlr92priWhKSMFoA5BE5hRgMSM8T6kB20sIys3lwwfjLMdZBMkAUCAlFC9BgEADm3BQAHkKPx8EQkABlKD5ChoTAgFJAA>" %}
