Skip to main content
POST
上传文件

Authorizations

Authorization
string
header
required

API Key 认证。对于所有 API 请求,请在 Authorization HTTP 头中包含您的 API Key,并加上 Bearer 前缀。示例:Authorization: Bearer {API_KEY}强烈建议将 API Key 存储在服务端,不要在客户端共享或存储,以避免 API Key 泄漏导致严重后果。缺少或无效的 API Key 会返回 HTTP 401,错误码为 unauthorized

Body

multipart/form-data

文件上传请求。需要 multipart/form-data 格式。

file
file
required

要上传的文件。支持的类型包括图片、文档、音频和视频。

user
string

用户标识符,由开发者定义的规则生成,必须在应用内唯一。Service API 与 WebApp 的用户 ID 相互独立,即使取值相同也不指向同一用户。省略时,上传会归属到共享的 DEFAULT-USER 终端用户;后续请求只有携带与上传时相同的 user 值才能使用该文件。

Response

文件上传成功。

id
string<uuid>

唯一文件 ID。

name
string

文件名。

size
integer

文件大小(字节)。

extension
string | null

文件扩展名。

mime_type
string | null

文件的 MIME 类型。

created_by
string<uuid> | null

上传文件的用户 ID。

created_at
integer<int64>

上传时间戳(Unix 纪元秒)。

preview_url
string | null

文件的预览 URL。

source_url
string

文件的签名下载 URL。

original_url
string | null

文件的原始 URL。

user_id
string<uuid> | null

未使用,始终为 null

tenant_id
string<uuid> | null

关联的租户 ID。

conversation_id
string<uuid> | null

关联的会话 ID。

file_key
string | null

未使用,始终为 null

Last modified on July 9, 2026