> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thornode.io/llms.txt
> Use this file to discover all available pages before exploring further.

# accountSubscribe

> Subscribe to an account to receive notifications when the lamports or data for a given account public key changes.

Subscribe to an account to receive notifications when the lamports or data for a given account public key changes.

## On ThorNode

Send over the complete `wss://` URL copied from the dashboard. Each active subscription counts toward the per-token cap; over the cap the request is answered with `-32005 subscription limit exceeded` and not forwarded. Frames pass through unchanged.

## Parameters

<ParamField body="params" type="array" required>
  <Expandable title="properties" defaultOpen>
    <ParamField body="pubkey" type="string" required>
      Account Pubkey, as base-58 encoded string.
    </ParamField>

    <ParamField body="encoding" type="string">
      Encoding format for account data. Can be `base58`, `base64`, `base64+zstd`, or `jsonParsed`.

      * `base58` is slow
      * `jsonParsed` encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data
      * If `jsonParsed` is requested but a parser cannot be found, the field falls back to binary encoding, detectable when the data field is type string.
    </ParamField>

    <ParamField body="commitment" type="string">
      The commitment level for the subscription. Can be `finalized`, `confirmed`, or `processed`.
    </ParamField>

    <ParamField body="notifyOn" type="string" deprecated>
      **Deprecated — no-op as of Agave 4.2.** Setting `notifyOn` has no effect. The field will be removed at a later date.
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="result" type="integer">
  Subscription id (needed to unsubscribe)
</ResponseField>

<RequestExample>
  ```json Request theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "accountSubscribe",
    "params": [
      "SysvarC1ock11111111111111111111111111111111",
      {
        "encoding": "jsonParsed",
        "commitment": "processed"
      }
    ]
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "jsonrpc": "2.0",
    "result": 3085,
    "id": 1
  }
  ```

  ```json Notification theme={null}
  {
    "jsonrpc": "2.0",
    "method": "accountNotification",
    "params": {
      "result": {
        "context": {
          "slot": 439749547
        },
        "value": {
          "lamports": 1169280,
          "data": {
            "program": "sysvar",
            "parsed": {
              "info": {
                "epoch": 1017,
                "epochStartTimestamp": 1786759601,
                "leaderScheduleEpoch": 1018,
                "slot": 439749547,
                "unixTimestamp": 1786928216
              },
              "type": "clock"
            },
            "space": 40
          },
          "owner": "Sysvar1111111111111111111111111111111111111",
          "executable": false,
          "rentEpoch": 18446744073709552000,
          "space": 40
        }
      },
      "subscription": 3085
    }
  }
  ```
</ResponseExample>
