mosoodocs
简体中文API Reference

上传 Agent file

在 Thread 存在之前,把文件上传到 Agent API Endpoint 的 App draft scope。返回的 file ID 可用于 create-thread 或 send-events 的 resources。

POST/agents/{agentId}/files

在 Thread 存在之前,把文件上传到 Agent API Endpoint 的 App draft scope。返回的 file ID 可用于 create-thread 或 send-events 的 resources。

Authorization

publicApiBearer
AuthorizationBearer <token>

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

In: header

Path Parameters

agentId*string

来自 Agent API Access 面板的 Agent API Endpoint ID。v1 ID 是不带前缀的 ULID。

Match^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
Formatulid

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/agents/01J00000000000000000000001/files" \  -F file="string"
{  "file": {    "createdAt": "2026-05-19T00:02:00.000Z",    "id": "01J0000000000000000000000J",    "mimeType": "text/plain",    "name": "brief.txt",    "size": 19  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}