> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validationcloud.io/llms.txt
> Use this file to discover all available pages before exploring further.

# unsubscribe

Tells the server to stop sending push messages for a particular subscription or set of subscriptions opened with `subscribe` on the same WebSocket connection. Available over WebSocket only.

This method will use `20` [Compute Units](/nodeapi/about/billing).

***

## Reference: [Here](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/subscription-methods/unsubscribe)

## **Parameters**

* `streams` (array, optional) Names of streams to unsubscribe from, such as `ledger`, `transactions`, `transactions_proposed`, `validations`, `manifests` or `book_changes`.
* `accounts` (array, optional) Account addresses to stop receiving updates for. This only stops messages if you previously subscribed to those accounts specifically; you cannot use it to filter accounts out of a stream.
* `accounts_proposed` (array, optional) Like `accounts`, but for `accounts_proposed` subscriptions that included not-yet-validated transactions.
* `books` (array, optional) Order books to unsubscribe from. Each member is an object with `taker_gets` and `taker_pays` (currency objects, omit `issuer` for XRP) and optionally `both` (remove the subscription for both sides of the book) and `domain` (permissioned DEX). A book subscribed with a `domain` is a different subscription from the open-DEX book, so send the same `domain` to remove it.

## Returns

* `result` (object) Empty on success. Push messages for the removed subscriptions stop after this response.

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// Result
// Documented response shape (xrpl.org)
{"id":2,"result":{},"status":"success","type":"response"}
```

<CodeGroup>
  ```bash title="mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  wscat -c wss://mainnet.xrpl.validationcloud.io/v1/<YOUR_API_KEY_HERE>

  {"id":1,"command":"subscribe","streams":["ledger"]}
  {"id":1,"result":{},"status":"success","type":"response"}
  {"id":2,"command":"unsubscribe","streams":["ledger"]}
  {"id":2,"result":{},"status":"success","type":"response"}
  ```
</CodeGroup>

The JSON-RPC shaped request `{"jsonrpc":"2.0","id":2,"method":"unsubscribe","params":[{"streams":["ledger"]}]}` is also accepted on the same WebSocket connection. Closing the WebSocket connection removes all of its subscriptions without needing an explicit `unsubscribe`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.