Modify User Security
POST/api/v1.0/quote/modify-user-securityModify user watchlist: add symbols to a group, remove from a specific group only, or delete from all groups entirely. Use user-security-group to query watchlist groups; use user-security to query symbols in a group.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
group_name | string | body | no | Watchlist group name (first match if duplicate names), max 100 characters; only custom groups supported. Required for op=ADD/MOVE_OUT; optional for op=DEL. |
op | string | body | yes | Operation type: ADD=add to specified group / DEL=delete from all groups entirely / MOVE_OUT=remove from specified group only. |
code_list | string[] | body | yes | List of symbol codes, must not be empty, 1-200 per call. e.g. ["HK.00700","US.AAPL"]. |
Request Example
bash
curl -X POST "https://webapi.moomoo.com/api/v1.0/quote/modify-user-security" \
-H "Content-Type: application/json" \
-d '{"group_name":"我的自选","op":"ADD","code_list":["HK.00700","US.AAPL"]}' | jqResponse Fields
| Field | Type | Description |
|---|---|---|
result_code | int | Operation result code, always 0 on success. |
Supported Markets
- Markets: All markets supported (HK / US / CN / SG / JP / cryptocurrency, etc.). Any valid code that resolves to a security is accepted.
- Categories: Stocks / ETF / warrants / options / futures / indices / bonds and all other categories.
- Groups: ADD / MOVE_OUT target a single custom group (one group_name per call); system preset groups cannot be targeted. DEL does not depend on groups and removes from all groups.
code_listmax 200 per call.
Error Codes
| ret_code | error.code | Trigger Condition | Handling |
|---|---|---|---|
| -3 | invalid_parameter | Missing op / invalid op / code_list empty or >200 / group_name >100 chars / op=ADD|MOVE_OUT missing group_name / group does not exist / code format error. | Correct request parameters and retry. |
| -7 | invalid_symbol | Code in code_list has valid format but security not found. | Verify code validity via search. |
| -8 | unsupported | Illegal add/remove on system / virtual groups. | Use custom groups instead. |
| -9 | permission_denied | User identity missing/invalid. | Add user identity and retry. |
| -5 | internal_error | Gateway or backend internal error. | Retry later; contact support if persistent. |
Response Example
json
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"result_code": 0
}
}