> For the complete documentation index, see [llms.txt](https://docs-protocol.loopring.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-protocol.loopring.io/resources/websocket/account-notification.md).

# Account Notification

### Rules <a href="#rules" id="rules"></a>

* Topic name: `account`&#x20;
* ApiKey requred: Yes

### Parameters <a href="#parameters" id="parameters"></a>

This topic has an optional flag: `v3`, which indicates the response is for v3 which has also include NFT info. if the flag is false or absent, the response is just like before.

<table><thead><tr><th>Parameter</th><th>Note</th><th data-hidden>Required</th></tr></thead><tbody><tr><td>accountId</td><td>(Optional) not required as apiKey also link to an account</td><td>N</td></tr><tr><td>v3</td><td>(Optional) If it's a v3 sub which contains NFT info, default is false for compatible with previous sub topic</td><td>N</td></tr></tbody></table>

### Notification example <a href="#notification-example" id="notification-example"></a>

```json
{
    "topic": {
        "topic:": "account"
    },
    "ts":1584717910000,
    "data": {
        "accountId":1,
        "totalAmount": "24439253519655",
        "tokenId": 2,
        "amountLocked": "0"
    }
}
```

### Data Model <a href="#data-model" id="data-model"></a>

**Notification**

If v3 is `true`:

<table><thead><tr><th>Field</th><th>Type</th><th>Note</th><th data-hidden>Required</th></tr></thead><tbody><tr><td>topic</td><td>JSON</td><td>Topic and parameters</td><td>Y</td></tr><tr><td>ts</td><td>integer</td><td>Notification timestamp (milliseconds)</td><td>Y</td></tr><tr><td>data</td><td><a href="#balancev3">BalanceV3</a></td><td>User's new balances (NFT info included)</td><td>Y</td></tr></tbody></table>

Otherwise:

<table><thead><tr><th>Field</th><th>Type</th><th>Note</th><th data-hidden>Required</th></tr></thead><tbody><tr><td>topic</td><td>JSON</td><td>Topic and parameters</td><td>Y</td></tr><tr><td>ts</td><td>integer</td><td>Notification timestamp (milliseconds)</td><td>Y</td></tr><tr><td>data</td><td><a href="#balance">Balance</a></td><td>User's new balances</td><td>Y</td></tr></tbody></table>

#### **BalanceV3**

<table><thead><tr><th>Field</th><th>Type</th><th>Note</th><th data-hidden>Required</th></tr></thead><tbody><tr><td>accountId</td><td>integer</td><td>Account ID</td><td>Y</td></tr><tr><td>tokenId</td><td>integer</td><td>Token ID</td><td>Y</td></tr><tr><td>total</td><td>string</td><td>Total token balance</td><td>Y</td></tr><tr><td>locked</td><td>string</td><td>Token balance locked by orders</td><td>Y</td></tr><tr><td>nftId</td><td>string</td><td>(Optional)NFT ID if it's NFT token</td><td>N</td></tr><tr><td>nftData</td><td>string</td><td>(Optional)NFT hash data if it's NFT token</td><td>N</td></tr><tr><td>tokenAddress</td><td>string</td><td>(Optional)NFT token address if it's NFT token</td><td>N</td></tr></tbody></table>

#### **Balance**

<table><thead><tr><th>Field</th><th>Type</th><th>Note</th><th data-hidden>Required</th></tr></thead><tbody><tr><td>accountId</td><td>integer</td><td>Account ID</td><td>Y</td></tr><tr><td>tokenId</td><td>integer</td><td>Token ID</td><td>Y</td></tr><tr><td>totalAmount</td><td>string</td><td>Total token balance</td><td>Y</td></tr><tr><td>amountLocked</td><td>string</td><td>Token balance locked by orders</td><td>Y</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-protocol.loopring.io/resources/websocket/account-notification.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
