Skip to main content
post/datasets/pipeline/file-upload
Request example
Response
post/datasets/pipeline/file-upload

Authorization

Authorizationstringheaderrequired#

每个请求都通过 API Key 认证:Authorization: Bearer {API_KEY}。应用接口使用应用 API Key,知识库接口使用知识库 API Key(快速开始)。

API Key 应保存在服务端,切勿嵌入客户端代码。缺失或无效的 Key 会返回 HTTP 401(unauthorized)。

Body

multipart/form-data
filefilerequired#

要上传的文件,作为 multipart/form-data 的一个部分。文档文件默认上限 15 MB。

自部署可通过 UPLOAD_FILE_SIZE_LIMIT 环境变量 调整。

Dify Cloud 的 Professional 和 Team 套餐的文档上限为 50 MB。图片、音频、视频文件各有独立上限,默认分别为 10 MB、50 MB、100 MB。

Responses

application/json
文件上传成功。
created_atstring#
上传时间戳(ISO 8601 格式)。在记录创建过程中可能为 null。
created_bystring#
上传文件的用户 ID。
extensionstring#
文件扩展名。
idstring#
已上传文件的唯一标识符。
mime_typestring#
文件的 MIME 类型。若上传未包含 MIME 类型则可能为 null。
namestring#
原始文件名。
sizeinteger#
文件大小(字节)。