---
title: programUnsubscribe
description: Cancel a programSubscribe websocket subscription.
url: /docs/rpc/websocket/programunsubscribe
type: reference
hideTableOfContents: true
---

Cancel an existing [programSubscribe](/docs/rpc/websocket/programsubscribe)
subscription.

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

<APIMethod>

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

### !params

#### !! subscription id

!type integer  
!required

Subscription id returned by `programSubscribe`.

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