accountSubscribe

accountSubscribe — Subscribe to account changes

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. Parameters

  1. pubkey (required) — Base-58 encoded public key.

  2. config (optional) — Optional configuration object. Every field is optional; omit the entire object to use defaults.

Authorizations
AuthorizationstringOptional

Pass Authorization: <api-key> on each request.

Body
jsonrpcstring · enumRequired

JSON-RPC protocol version.

Example: 2.0Possible values:
idone ofRequired

Request identifier echoed back in the response.

Example: 1
stringOptional
or
integerOptional
methodstring · enumRequired

Must be accountSubscribe.

Example: accountSubscribePossible values:
Responses
200

Successful accountSubscribe response.

application/json

Base envelope of every JSON-RPC 2.0 response.

jsonrpcstring · enumRequiredExample: 2.0Possible values:
idone ofRequired

Echoed request id.

Example: 1
stringOptional
or
integerOptional
resultinteger · int64Required

Subscription id. Save this value to call the matching unsubscribe method later.

Example: 24040
post
/

Last updated