> ## 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.

# Create Topic

> Create a topic following

## 说明

**URL**: `/v1/followings/topics`
**方法**: `POST`\
**描述**: 创建话题，为当前用户新增一个话题关注，返回创建后的关注项。

### 请求参数

| 参数名        | 类型     | 必填 | 描述           |
| ---------- | ------ | -- | ------------ |
| query      | str    | 是  | 话题查询文本。      |
| meta\_data | object | 否  | 可选的话题范围限定信息。 |

### 响应参数

| 参数名               | 类型  | 描述                          |
| ----------------- | --- | --------------------------- |
| 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 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "query": "AI 芯片行业趋势"
}'
```

**Python**

```python theme={null}
import requests

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

data = {
    "query": "AI 芯片行业趋势",
    # 可选：限定话题范围
    # "meta_data": {"symbols": ["00700", "AAPL"]}
}

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
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:
    post:
      tags:
        - openapi-followings
      summary: Create Topic
      description: Create a topic following
      operationId: create_topic_reportify_api_v1_followings_topics_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAITopicCreateRequest'
        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:
    OAITopicCreateRequest:
      properties:
        query:
          type: string
          title: Query
          description: Topic query text
        meta_data:
          type: object
          title: Meta Data
          description: Optional topic scope
      type: object
      required:
        - query
      title: OAITopicCreateRequest
      description: Request model for creating 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

````