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

# Update Topic

> Update an existing topic following

## 说明

**URL**: `/v1/followings/topics/{follow_id}`
**方法**: `POST`\
**描述**: 编辑话题，更新已存在的话题关注，返回更新后的关注项。

### 请求参数

| 参数名        | 类型     | 必填 | 位置   | 描述           |
| ---------- | ------ | -- | ---- | ------------ |
| follow\_id | str    | 是  | path | 话题关注 ID。     |
| query      | str    | 是  | body | 话题查询文本。      |
| meta\_data | object | 否  | body | 可选的话题范围限定信息。 |
| title      | str    | 否  | body | 话题标题。        |

### 响应参数

| 参数名               | 类型  | 描述                          |
| ----------------- | --- | --------------------------- |
| follow\_id        | str | 关注 ID。                      |
| follow\_type      | int | 关注类型：`1` 公司，`2` 话题，`3` 渠道。  |
| follow\_sub\_type | int | 关注子类型：`1` 机构，`2` 媒体，`3` 社交。 |
| follow\_value     | str | 关注对象的取值。                    |
| name              | str | 名称。                         |
| logo              | str | 图标 URL。                     |
| title             | str | 标题。                         |
| followed\_at      | int | 关注时间戳（毫秒）。                  |

### 请求示例

**cURL**

```bash theme={null}
curl -X POST https://api.reportify.cn/v1/followings/topics/2002 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "query": "AI 芯片行业趋势与供应链",
    "title": "AI 芯片行业趋势"
}'
```

**Python**

```python theme={null}
import requests

follow_id = "2002"
url = f"https://api.reportify.cn/v1/followings/topics/{follow_id}"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

data = {
    "query": "AI 芯片行业趋势与供应链",
    "title": "AI 芯片行业趋势"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
```

### 响应示例

```json theme={null}
{
  "follow_id": "2002",
  "follow_type": 2,
  "follow_sub_type": 0,
  "follow_value": "AI 芯片行业趋势与供应链",
  "name": "AI 芯片行业趋势",
  "logo": "",
  "title": "AI 芯片行业趋势",
  "followed_at": 1720000100000
}
```

### 错误响应

| 状态码 | 描述        |
| --- | --------- |
| 422 | 请求参数验证失败。 |


## OpenAPI

````yaml POST /v1/followings/topics/{follow_id}
openapi: 3.1.0
info:
  title: Reportify API
  version: 1.0.0
  description: API documentation for Reportify's document management and search services.
servers:
  - url: https://api.reportify.cn
    description: Production server
security:
  - BearerAuth: []
paths:
  /v1/followings/topics/{follow_id}:
    post:
      tags:
        - openapi-followings
      summary: Update Topic
      description: Update an existing topic following
      operationId: update_topic_reportify_api_v1_followings_topics__follow_id__post
      parameters:
        - description: Follow ID
          required: true
          schema:
            type: string
            title: Follow Id
            description: Follow ID
          name: follow_id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAITopicUpdateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAIFollowingItem'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    OAITopicUpdateRequest:
      properties:
        query:
          type: string
          title: Query
        meta_data:
          type: object
          title: Meta Data
        title:
          type: string
          title: Title
      type: object
      required:
        - query
      title: OAITopicUpdateRequest
      description: Request model for updating a topic following
    OAIFollowingItem:
      properties:
        follow_id:
          type: string
          title: Follow Id
        follow_type:
          type: integer
          title: Follow Type
          description: 1 company, 2 topic, 3 channel
        follow_sub_type:
          type: integer
          title: Follow Sub Type
          description: 1 institution, 2 media, 3 social
        follow_value:
          type: string
          title: Follow Value
        name:
          type: string
          title: Name
        logo:
          type: string
          title: Logo
        title:
          type: string
          title: Title
        followed_at:
          type: integer
          title: Followed At
      type: object
      required:
        - follow_id
        - follow_type
      title: OAIFollowingItem
      description: A unified following item (company/topic/channel)
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your Bearer token

````