accountSubscribe

accountSubscribe WebSocket Method

post
/

Subscribe to an account to receive notifications when the lamports or data for a given account public key changes. Returns a subscription ID that can be used to unsubscribe. This method establishes a persistent WebSocket connection that will send real-time notifications whenever the specified account's state changes on the blockchain.

Authorizations
AuthorizationstringOptional

Authorization header for API key authentication.

Example:

Authorization: your-api-key-here
Body

Request object for subscribing to account changes via WebSocket

jsonrpcstring · enumRequired

JSON-RPC protocol version

Example: 2.0Possible values:
idone ofRequired

Request identifier that will be returned in the response

Example: 1
stringOptional
or
numberOptional
methodstring · enumRequired

The WebSocket method name

Example: accountSubscribePossible values:
Responses
chevron-right
200

Subscription successfully created

application/json

Response containing the subscription ID for the account subscription

jsonrpcstring · enumRequired

JSON-RPC protocol version

Example: 2.0Possible values:
idone ofRequired

Request identifier matching the original request

Example: 1
stringOptional
or
numberOptional
resultintegerOptional

Unique subscription ID for this account subscription. Use this ID to unsubscribe from notifications using the accountUnsubscribe method.

Example: 23784
post
/

Last updated