# Archive / Unarchive Wallet

## Archive / Unarchive a Wallet

Using this endpoint, users can choose to archive or unarchive a specific wallet in their organization, according to a wallet ID.

{% hint style="info" %}
Note that this mutation is supported across all wallet types. *(inabit, exchanges, web3)*
{% endhint %}

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

### **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            |
| -------------------------------------------- | ------- | ---------------------- |
| Id<mark style="color:red;">\*</mark>         | String  | Wallet ID              |
| isArchived<mark style="color:red;">\*</mark> | Boolean | Archived or not (flag) |

Example body:

```json
{
  "where": {
    "id": "clllyfdk6006ybtqkwk840uei"
  },
  "data": {
    "isArchived": true
    }
}
```

### Response

Return values:

| Name                                         | Type    | Description            |
| -------------------------------------------- | ------- | ---------------------- |
| Id<mark style="color:red;">\*</mark>         | String  | Wallet ID              |
| isArchived<mark style="color:red;">\*</mark> | Boolean | Archived or not (flag) |

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

```javascript
{
  "data": {
    "updateWallet": {
      "id": "clpgvhulg000f6s0171foixj6",
      "isArchived": true,   // false for unArchived
    }
  }
}
```

{% endtab %}

{% tab title="🔴 Failure" %}

{% endtab %}
{% endtabs %}

**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-QVvcDNO3EO18XAtrW3sSEgIwGzsIiIIAZwBBPihuAgA3BGiwiIBfGKQ8kHUQDNw+AlwAI2YEjBBQ2JIrEG8EVqEm8JaQKM7eqCYGAE8AMzAAawA2AAZZ6ZHqlBlJzkmADgAWWfkCVsL89UPevwHuuN7ElLTM7IGxxgSEEpBeXDB+eswDkFeKCAJFBjBgEADm3BQAHkKPx8EQkABlKCVChoTAgPJAA>" %}
