# Disconnect Exchange Wallet

## Disconnect an Exchange Wallet

Mutation to disconnect a connected exchange wallet from an organization according to the exchange wallet's ID.

{% hint style="info" %}
Note that this mutation can only occur on a wallet marked as "Exchange wallet" in its type.
{% endhint %}

```graphql
mutation DisconnectWallet($walletId: String!) {
  disconnectWallet(walletId: $walletId) {
    success
  }
}
```

### **Headers**

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

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

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | String | Wallet ID   |

Example body:

```json
{
  "walletId": "clpgvhulg000f6s0171foixj6"
}
```

### Response

Return values:

| Name    | Type    | Description                                           |
| ------- | ------- | ----------------------------------------------------- |
| success | Boolean | Returns true if disconnect was successful, else false |

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

```json
{
  "data": {
    "disconnectWallet": {
      "success": true,
    }
  }
}
```

{% 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=N4IgJg9gxgrgtgUwHYBcQC4RxighigSwiQAIARAgZymKQShQHVcAbFhFACgBIB3V9igCSYdCQDKKAE4EkAcwCEAShLAAOlLWkSYKjSR0GzNh078Tw0ST4COIles3aSJSjChQElShq0uAvr5I-iAANCAAbrgyuABG7JQYII5+JGog5oIi6WJIMGxBIeEAFgi4YAhSiZjp6WEgAA4QlCgAZiwEcsUoAPINlfhESOJQMg1omCD+QA>" %}


---

# 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.inabit.com/api-reference/develop-with-inabit-api/wallets/disconnect-exchange-wallet.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.
