Reference
Common request structure and enum values used by the WebSocket methods of the Public API.
Request Structure
Every request is a JSON object with at least:
| Field | Type | Required | Description |
|---|---|---|---|
method | string | Yes | Method name: assign, notify, open, open_aggregated, ping, etc. |
exchange | number | For assign, open, open_aggregated | Exchange identifier (see below). |
market_type | number | For assign, open, open_aggregated | 0 = Spot, 1 = Futures. |
symbol | string | For assign, open, open_aggregated | Display symbol, no separators (e.g. TRXUSDT). |
linking_type | number or string | For assign (yes); for open (optional) | Link color slot. See below and LinkingType in JSON. |
title | string | For open_aggregated (optional) or notify | Aggregated set: tab title; if empty, the server can read extra.title. Notify: notification title. |
message | string | For notify | Notification body. |
extra | object | No | Optional key-value data (e.g. title for open_aggregated). |
Symbol Format
Always use the display symbol without separators. Examples:
- Correct:
TRXUSDT - Incorrect:
TRX_USDT,TRX-USDT
Different exchanges may show the pair as TRX/USDT or TRX-USDT in the UI; in the API always send the compact form, e.g. TRXUSDT.
Exchange (exchange)
| Value | Exchange |
|---|---|
| 0 | Binance |
| 1 | Bybit |
| 2 | Okx |
| 3 | Kucoin |
| 4 | Gate |
| 5 | Bitget |
| 6 | Mexc |
| 7 | Htx |
| 8 | HyperLiquid |
| 9 | Upbit |
| 10 | BingX |
| 11 | Aster |
| 12 | Lighter |
Market Type (market_type)
| Value | Market |
|---|---|
| 0 | Spot |
| 1 | Futures |
LinkingType in JSON
linking_type may be a number (enum int) or a string: a decimal string, or a member name such as Link1, Link2, None (case-insensitive). For assign, a valid link slot is required. For open, the field is optional; resolution follows the same rules as the watchlist and Method - open.
Link Color (linking_type)
Used by the assign method to choose which linked instrument to update, and by optional open to choose in which color to create the new set. For assign, values 0 (None) and 1 (LinkAuto) are not meaningful; assignable link slots start at 2 (Link1). For open, 0 = unlinked, 1 = LinkAuto (treated as “use available” when creating a new set), 2+ = a specific color.
| Value | Color |
|---|---|
| 2 | Firebrick |
| 3 | Forest green |
| 4 | Medium blue |
| 5 | Yellow |
| 6 | Purple |
| 7 | Crimson |
| 8 | Lime green |
| 9 | Dark cyan |
| 10 | Sandy brown |
| 11 | Hot pink |
| 12 | Chocolate |
| 13 | Aquamarine |
| 14 | Slate blue |
| 15 | Fuchsia |
| 16 | Navy |
| 17 | Orange red |
| 18 | Deep sky blue |
| 19 | Gold |
| 20 | Medium violet red |
| 21 | Dark olive green |
Error responses
Error payloads use "status":"error", a stable numeric error_code (values start at 1000), and a human-readable message.
error_code | Typical situation |
|---|---|
1000 | Request body is not valid JSON. |
1001 | Parsed JSON is empty or not a usable request object. |
1002 | No method field or it is blank. |
1003 | Required fields for the method are missing (for example exchange, market_type, symbol for open). |
1004 | The method value is not supported. |
1005 | Symbol / exchange / market type combination not recognized when opening a set. |
1006 | Aggregated open: no exchanges available for the resolved pair. |
1007 | No workspace window available to host the new instrument set. |
1008 | The workspace could not create the instrument set (check chart / order book layout options). |
These codes are reused across methods; method pages include concrete JSON examples.