# 管理分組標的

`PUT` `/v1/watchlist/groups`

> **行情權限要求 · 免費**
> 開通 OpenAPI 後自動獲得，無需額外購買。
> _OpenAPI 行情權限獨立於 App/Web 行情權限_

更新自選股分組

## Parameters

### Request Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | Yes | 自選股分組 ID。 |
| `name` | string | No | 新的分組名稱。 |
| `securities` | array | No | 按 `mode` 增/刪/替換的證券代碼列表。 |
| `mode` | string | Yes | 證券更新模式：`add`、`remove`、`replace`。 |

## Request Example

```bash
curl --request PUT \
  --url 'https://openapi.longbridge.com/v1/watchlist/groups' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{"id":0,"name":"<name>","securities":[],"mode":"<mode>"}'
```

## Response

### Response JSON Example

```json
{
  "code": 0
}
```
