> ## Documentation Index
> Fetch the complete documentation index at: https://adp-doc.laiye.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 文件上传

> 上传文件到智能引擎存储，返回文件 ID 和下载地址。上传后的文件可在运行工作流接口的 files 参数中使用。



## OpenAPI

````yaml /api-reference/adp-api.yaml post /open/agentic_engine/laiye/files/upload
openapi: 3.1.0
info:
  title: ADP API
  version: 1.0.0
  description: Laiye ADP 官方 OpenAPI 接口规范，覆盖文档抽取、文档解析、抽取应用管理、积分查询、工作流运行和工作流文件管理。
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://adp.laiye.com
    description: ADP 生产环境
security: []
tags:
  - name: 文档抽取
    description: 从上传的文档中抽取结构化字段。
  - name: 文档解析
    description: 识别上传文档中的文字、版面块和位置信息。
  - name: 应用管理
    description: 创建、修改、删除和查询抽取应用及配置。
  - name: 账户
    description: 查询账户积分和使用情况。
  - name: 工作流
    description: 运行工作流应用并查询执行结果。
  - name: 工作流文件
    description: 上传和管理工作流应用使用的文件。
paths:
  /open/agentic_engine/laiye/files/upload:
    post:
      tags:
        - 工作流文件
      summary: 文件上传
      description: 上传文件到智能引擎存储，返回文件 ID 和下载地址。上传后的文件可在运行工作流接口的 files 参数中使用。
      operationId: uploadDocFlowFile
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileUploadRequest'
      responses:
        '200':
          $ref: '#/components/responses/FileResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - EngineApiKeyAuth: []
components:
  schemas:
    FileUploadRequest:
      type: object
      additionalProperties: false
      properties:
        chunk:
          type: string
          format: binary
        application_id:
          type: string
        sharing_scope:
          type: string
          enum:
            - user
            - application
          default: application
      required:
        - chunk
    FileResponse:
      allOf:
        - $ref: '#/components/schemas/SimpleResponse'
        - type: object
          properties:
            data:
              type: object
              additionalProperties: true
              properties:
                id:
                  type: string
                file_name:
                  type: string
                file_size:
                  type: integer
                content_type:
                  type: string
                download_url:
                  type: string
                status:
                  type: string
    SimpleResponse:
      type: object
      properties:
        code:
          oneOf:
            - type: string
            - type: integer
          description: 业务码。成功通常为 success 或 200。
        message:
          type: string
          description: 返回信息。
        tips:
          type:
            - string
            - 'null'
          description: 详细信息，默认为空。
  responses:
    FileResponse:
      description: 文件信息。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FileResponse'
    ValidationError:
      description: 参数校验错误。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleResponse'
  securitySchemes:
    EngineApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: 工作流智能引擎 API 访问密钥。

````