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

# Docs Form Upload

> Upload files via form

## 同步上传文档

**URL**: `/v1/docs/upload/form`\
**方法**: `POST`\
**Content-Type**: `multipart/form-data`
**描述**: 同步上传单篇报告文档至指定文件夹。

### 请求参数

| 参数名           | 类型        | 描述                                              |
| ------------- | --------- | ----------------------------------------------- |
| file          | str(file) | 文件。                                             |
| folder\_id    | str       | 目标文件夹 ID。                                       |
| name          | str       | 文档名称。                                           |
| tags          | str       | 标签 (JSON 字符串)。                                  |
| metadatas     | str       | 元数据 (JSON 字符串)。                                 |
| published\_at | str       | 发布时间，格式为 millisecond timestamp `1712832000000`。 |

tags 和 metadatas 的格式为 JSON 字符串，示例如下：

```
'{"tags": "{\"industry\": \"科技\", \"company\": \"特斯拉\"}}'
'{"metadatas": "{\"periods\": \"Q4 2023\", \"entities\": [\"Tesla Inc.\", \"TSLA\"]}"}'
```

### 响应参数

| 参数名           | 类型  | 描述      |
| ------------- | --- | ------- |
| id            | str | 文档唯一 ID |
| title         | str | 文档标题    |
| original\_url | str | 文档URL   |


## OpenAPI

````yaml POST /v1/docs/upload/form
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/docs/upload/form:
    post:
      tags:
        - openapi-files
      summary: Upload Doc By Form
      description: Upload files via form
      operationId: upload_doc_by_form_reportify_api_v1_docs_upload_form_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_doc_by_form_reportify_api_v1_docs_upload_form_post
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAIDocsIdResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    Body_upload_doc_by_form_reportify_api_v1_docs_upload_form_post:
      properties:
        file:
          type: string
          format: binary
          title: File
        folder_id:
          type: string
          title: Folder Id
          description: Folder ID, if you do not pass it, use the default folder
        name:
          type: string
          title: Name
          description: File name, if you do not pass it, use the file name in the URL
        metadatas:
          type: string
          title: Metadatas
          description: >-
            metadatas json string, example: {"period": "2023Q4", "entities":
            ["companyA", "companyB"]}
        published_at:
          type: integer
          title: Published At
          description: Document release time, millisecond time stamp
        tags:
          type: string
          title: Tags
          description: >-
            Document tag list, json string, example: {"key": ["value1",
            "value2"]}
      type: object
      required:
        - file
      title: Body_upload_doc_by_form_reportify_api_v1_docs_upload_form_post
    OAIDocsIdResponse:
      properties:
        id:
          type: string
          title: Id
        title:
          type: string
          title: Title
        original_url:
          type: string
          title: Original Url
      type: object
      required:
        - id
        - title
        - original_url
      title: OAIDocsIdResponse
    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

````