# rootSubscribe

## rootSubscribe WebSocket Method

> Subscribe to receive notification anytime a new root is set by the validator. This method establishes a persistent WebSocket connection that will send real-time notifications whenever the validator updates the root slot. The root represents the most recent slot that has been finalized and committed to the ledger. This subscription is useful for tracking the overall progress of the blockchain and understanding when transactions become irreversibly confirmed.<br>

````json
{"openapi":"3.0.3","info":{"title":"Solana WebSocket API - rootSubscribe Method","version":"1.0.0"},"tags":[{"name":"Root Notifications","description":"Methods related to monitoring blockchain finality via root slot notifications. The root represents the most recent slot that has been finalized and committed to the ledger. These notifications help track the overall progress of the blockchain and determine when transactions become irreversibly confirmed. Root changes indicate that all previous slots are now permanently part of the blockchain history.\n"}],"servers":[{"url":"wss://public.rpc.solanavibestation.com","description":"SVS Public WebSocket Node Endpoint"},{"url":"wss://basic.rpc.solanavibestation.com"},{"url":"wss://ultra.rpc.solanavibestation.com"},{"url":"wss://elite.rpc.solanavibestation.com"},{"url":"wss://epic.rpc.solanavibestation.com"},{"url":"wss://basic.swqos.solanavibestation.com"},{"url":"wss://ultra.swqos.solanavibestation.com"},{"url":"wss://elite.swqos.solanavibestation.com"}],"security":[{},{"AuthHeader":[]},{"URLParameter":[]}],"components":{"securitySchemes":{"AuthHeader":{"type":"apiKey","in":"header","name":"Authorization","description":"Authorization header for API key authentication.\n\n**Example:**\n```\nAuthorization: your-api-key-here\n```\n"},"URLParameter":{"type":"apiKey","in":"query","name":"api_key","description":"API key passed as a URL parameter for authentication.\n\n**Example:**\n```\nwss://public.rpc.solanavibestation.com/?api_key=your-api-key-here\n```\n"}},"schemas":{"RootSubscribeRequest":{"type":"object","description":"Request object for subscribing to root change notifications via WebSocket","required":["jsonrpc","id","method"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier that will be returned in the response"},"method":{"type":"string","description":"The WebSocket method name","enum":["rootSubscribe"]}}},"RootNotification":{"type":"object","description":"WebSocket notification sent when a new root is set by the validator","required":["jsonrpc","method","params"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"method":{"type":"string","description":"Notification method name indicating this is a root notification","enum":["rootNotification"]},"params":{"type":"object","description":"Notification parameters containing the root slot information","required":["result","subscription"],"properties":{"result":{"type":"integer","description":"The latest root slot number. This represents the most recent slot that has been finalized and committed to the ledger. All slots up to and including this number are now permanently part of the blockchain history.\n","minimum":0},"subscription":{"type":"integer","description":"Subscription ID that triggered this notification. Matches the ID returned from the initial rootSubscribe call.\n","minimum":0}}}}},"RootSubscribeResponse":{"type":"object","description":"Response containing the subscription ID for the root subscription","required":["jsonrpc","id"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier matching the original request"},"result":{"type":"integer","description":"Unique subscription ID for this root subscription. Use this ID to unsubscribe from notifications using the rootUnsubscribe method.\n","minimum":0},"error":{"$ref":"#/components/schemas/RpcError"}}},"RpcError":{"type":"object","description":"Standard JSON-RPC error object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Numeric error code following JSON-RPC 2.0 specification:\n- `-32700`: Parse error - Invalid JSON was received\n- `-32600`: Invalid request - The JSON sent is not a valid request object\n- `-32601`: Method not found - The method does not exist\n- `-32602`: Invalid params - Invalid method parameter(s)\n- `-32603`: Internal error - Internal JSON-RPC error\n- `-32000`: Server error - WebSocket connection issues or subscription limits\n"},"message":{"type":"string","description":"Human-readable error message describing the error"},"data":{"type":"object","description":"Additional structured error information (optional). May contain specific details about what caused the error.\n","additionalProperties":true}}},"ErrorResponse":{"type":"object","description":"JSON-RPC error response for failed requests","required":["jsonrpc","error","id"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"error":{"$ref":"#/components/schemas/RpcError"},"id":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"null"}],"description":"Request identifier from the original request, or null if the request was malformed and no ID could be extracted."}}}}},"paths":{"/":{"post":{"summary":"rootSubscribe WebSocket Method","description":"Subscribe to receive notification anytime a new root is set by the validator. This method establishes a persistent WebSocket connection that will send real-time notifications whenever the validator updates the root slot. The root represents the most recent slot that has been finalized and committed to the ledger. This subscription is useful for tracking the overall progress of the blockchain and understanding when transactions become irreversibly confirmed.\n","operationId":"rootSubscribe","tags":["Root Notifications"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RootSubscribeRequest"}}}},"responses":{"101":{"description":"WebSocket notification for root changes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RootNotification"}}}},"200":{"description":"Subscription successfully created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RootSubscribeResponse"}}}},"400":{"description":"Bad Request - Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden","content":{"text/plain":{"schema":{"type":"string"}}}},"429":{"description":"Too Many Requests","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
````
