跳转到主要内容
POST
/
threads
/
{threadId}
/
files
添加 Thread 文件
curl --request POST \
  --url https://docs.mosoo.ai/api/v1/threads/{threadId}/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fileId": "01J0000000000000000000000J"
}
'
{
  "file": {
    "committed": true,
    "createdAt": "2026-05-19T00:02:00.000Z",
    "id": "01J0000000000000000000000J",
    "kind": "attachment",
    "mimeType": "text/plain",
    "name": "brief.txt",
    "size": 19
  }
}

授权

Authorization
string
header
必填

使用 Authorization: Bearer mst_...。API token 用于识别账号,不携带 scope。

路径参数

threadId
string<ulid>
必填

create thread 返回的 Thread ID。v1 ID 是不带前缀的 ULID。

Pattern: ^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
示例:

"01J00000000000000000000009"

请求体

application/json

把之前上传的草稿文件句柄声明到 Thread 中的请求体。

fileId
string<ulid>
必填

同一个 API token 调用方之前通过文件数据平面上传、且已准备好的草稿文件 ID(不带前缀的 ULID)。

Required string length: 1 - 26
Pattern: ^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
示例:

"01ARZ3NDEKTSV4RRFFQ69G5FAV"

响应

已创建 Thread 文件。

单个 Thread 文件。

file
object
必填

Thread 文件。