---
title: accountUnsubscribe
description: Cancel an accountSubscribe websocket subscription.
url: /docs/rpc/websocket/accountunsubscribe
type: reference
hideTableOfContents: true
---

Cancel an existing [accountSubscribe](/docs/rpc/websocket/accountsubscribe)
subscription.

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

<APIMethod>

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

### !params

#### !! subscription id

!type integer !required

Subscription id returned by `accountSubscribe`.

### !!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>
