# rootSubscribe

> Emits a notification each time the validator advances its root (permanently finalized) slot.

Source: https://docs.constant-k.com/rpc/websocket/rootsubscribe/

A slot becomes root once Agave has settled it so it can never be rolled back. `rootSubscribe` fires once per root advance, far less often than `slotSubscribe`, which fires on every processed slot regardless of finality.

The call takes no parameters, and the notification's `result` is the new root slot number, unlike `accountNotification`, `programNotification` or `logsNotification`, which wrap `value` in a `context` object.

- Transport: WebSocket, JSON-RPC 2.0 over `wss://ws-newyork.constant-k.com:1337/ws?api-key=YOUR_API_KEY`
- Category: Subscriptions
- Availability: Operator and above

## Parameters

None.

## Result

- `result` (integer, optional): The subscription id, returned once in the initial RPC response. Passed to `rootUnsubscribe`, it cancels the stream.

## Notifications

Updates arrive as `rootNotification` messages. The newly-rooted slot number itself — a bare integer, not wrapped in a `context`/`value` object.

- `params.result` (integer, optional): The new root slot.

## Unsubscribe

`rootUnsubscribe`, called with the subscription id, returns `true` once the subscription is removed.

## Example: Subscribe to root updates

Request (send after connecting):

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "rootSubscribe"
}
```

Response:

```json
{
  "jsonrpc": "2.0",
  "result": 23003808,
  "id": 1
}
```

Notification:

```json
{
  "jsonrpc": "2.0",
  "method": "rootNotification",
  "params": {
    "result": 447946369,
    "subscription": 23003808
  }
}
```

## Notes

- WebSocket access is included on the Operator plan and above; it is not available on Free.
- Concurrent connections are capped per API key: 10 on Operator, 50 on Blade Runner, 100 on Nexus.
- Subscribe and unsubscribe calls draw from the same global per-plan request-rate limit as HTTP calls: 50 req/s on Operator, 200 req/s on Blade Runner, 500 req/s on Nexus.
- Only subscription methods (the `*Subscribe` / `*Unsubscribe` family) are accepted on the WebSocket endpoint; standard request/response RPC methods must go over HTTPS instead.
- A `getHealth` request sent over the open socket on a regular interval serves as a keepalive; connections that go quiet can be dropped by intermediate load balancers.
- Each region has its own WebSocket hostname, for example `wss://ws-newyork.constant-k.com:1337/ws?api-key=YOUR_API_KEY`; every region is listed on the Endpoints page.
- Captured live from `wss://api.mainnet-beta.solana.com`.

