---
title: Solana RPC WebSocket Methods
description: >-
  Reference index for Solana RPC WebSocket methods. Use this page to find PubSub
  subscription methods by category, shared JSON-RPC WebSocket request
  conventions, and links to detailed method pages.
url: /docs/rpc/websocket
type: reference
related:
  - /docs/rpc
  - /docs/rpc/json-structures
  - /docs/rpc/http
---

Open an individual method page for request parameters, examples, notification
payloads, and unsubscription behavior. For shared response objects reused across
WebSocket methods, see
[Solana RPC JSON Structures Reference](/docs/rpc/json-structures).

## Request Format

Solana RPC WebSocket methods use
[JSON-RPC 2.0](https://www.jsonrpc.org/specification) over a persistent
WebSocket connection. Connect to the PubSub endpoint at `ws://<ADDRESS>/` or
`wss://<ADDRESS>/`.

| Field     | Type                       | Description                                                                         |
| --------- | -------------------------- | ----------------------------------------------------------------------------------- |
| `jsonrpc` | `string`                   | JSON-RPC version. Set this to `"2.0"`.                                              |
| `id`      | `string \| number \| null` | Client-supplied request identifier. The server echoes it in the subscribe response. |
| `method`  | `string`                   | PubSub method name, such as `accountSubscribe` or `slotSubscribe`.                  |
| `params`  | `array`                    | Ordered method parameters. Use an empty array when the method takes no parameters.  |

Many subscription methods take the optional
[`commitment` parameter](/docs/rpc#configuring-state-commitment). If
unspecified, subscriptions that accept commitment default to `finalized`.

## Notification Format

After a subscribe request succeeds, the server returns a numeric subscription id
in the JSON-RPC response. Later notifications are pushed as JSON-RPC messages
with a method-specific notification name and the active subscription id.

| Field                 | Type     | Description                                                                                                  |
| --------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `jsonrpc`             | `string` | JSON-RPC version.                                                                                            |
| `method`              | `string` | Notification name, such as `accountNotification` or `slotNotification`.                                      |
| `params.result`       | `any`    | Method-specific notification payload. Many methods include a `context` object and a method-specific `value`. |
| `params.subscription` | `number` | Subscription id returned by the corresponding `*Subscribe` method.                                           |

For notifications that include `context` and `value`, PubSub includes
`context.slot` and omits `context.apiVersion`.

## Method Reference

### Accounts

| Method                                                         | Description                                                            |
| -------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [`accountSubscribe`](/docs/rpc/websocket/accountsubscribe)     | Subscribe to notifications when one account's lamports or data change. |
| [`accountUnsubscribe`](/docs/rpc/websocket/accountunsubscribe) | Cancel an `accountSubscribe` subscription.                             |
| [`programSubscribe`](/docs/rpc/websocket/programsubscribe)     | Subscribe to notifications for accounts owned by a program.            |
| [`programUnsubscribe`](/docs/rpc/websocket/programunsubscribe) | Cancel a `programSubscribe` subscription.                              |

### Transactions

| Method                                                             | Description                                                      |
| ------------------------------------------------------------------ | ---------------------------------------------------------------- |
| [`logsSubscribe`](/docs/rpc/websocket/logssubscribe)               | Subscribe to transaction log messages that match a log filter.   |
| [`logsUnsubscribe`](/docs/rpc/websocket/logsunsubscribe)           | Cancel a `logsSubscribe` subscription.                           |
| [`signatureSubscribe`](/docs/rpc/websocket/signaturesubscribe)     | Subscribe to status notifications for one transaction signature. |
| [`signatureUnsubscribe`](/docs/rpc/websocket/signatureunsubscribe) | Cancel a `signatureSubscribe` subscription.                      |

### Blocks

| Method                                                     | Description                                                                         |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [`blockSubscribe`](/docs/rpc/websocket/blocksubscribe)     | Subscribe to block notifications as blocks reach confirmed or finalized commitment. |
| [`blockUnsubscribe`](/docs/rpc/websocket/blockunsubscribe) | Cancel a `blockSubscribe` subscription.                                             |

### Cluster

| Method                                                                   | Description                                                          |
| ------------------------------------------------------------------------ | -------------------------------------------------------------------- |
| [`rootSubscribe`](/docs/rpc/websocket/rootsubscribe)                     | Subscribe to notifications when the validator sets a new root slot.  |
| [`rootUnsubscribe`](/docs/rpc/websocket/rootunsubscribe)                 | Cancel a `rootSubscribe` subscription.                               |
| [`slotSubscribe`](/docs/rpc/websocket/slotsubscribe)                     | Subscribe to notifications when the validator processes a new slot.  |
| [`slotUnsubscribe`](/docs/rpc/websocket/slotunsubscribe)                 | Cancel a `slotSubscribe` subscription.                               |
| [`slotsUpdatesSubscribe`](/docs/rpc/websocket/slotsupdatessubscribe)     | Subscribe to tagged slot lifecycle updates emitted by the validator. |
| [`slotsUpdatesUnsubscribe`](/docs/rpc/websocket/slotsupdatesunsubscribe) | Cancel a `slotsUpdatesSubscribe` subscription.                       |
| [`voteSubscribe`](/docs/rpc/websocket/votesubscribe)                     | Subscribe to gossip vote notifications.                              |
| [`voteUnsubscribe`](/docs/rpc/websocket/voteunsubscribe)                 | Cancel a `voteSubscribe` subscription.                               |
