---
title: rootUnsubscribe
description: Cancel a rootSubscribe websocket subscription.
url: /docs/rpc/websocket/rootunsubscribe
type: reference
hideTableOfContents: true
---

Cancel an existing [rootSubscribe](/docs/rpc/websocket/rootsubscribe)
subscription.

<Callout type="info" title="Source">
  [`root_unsubscribe`](https://github.com/anza-xyz/agave/blob/v3.1.8/rpc/src/rpc_pubsub.rs#L600)
</Callout>

<APIMethod>

```jsonc !!request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "rootUnsubscribe",
  "params": [0]
}
```

### !params

#### !! subscription id

!type integer  
!required

Subscription id returned by `rootSubscribe`.

### !!result

```jsonc !response
{
  "jsonrpc": "2.0",
  "result": true,
  "id": 1
}
```

!type boolean

Returns `true` if the subscription was removed. Returns an error if the
subscription id is unknown.

</APIMethod>
