跳转到主要内容
Session & Event

运行时挂载资源

在会话运行期间动态挂载文件

POST
/api/v1/agentstudio/sessions/{session_id}/resources
cURL
curl --request POST \
  --url 'https://dashscope.aliyuncs.com/api/v1/agentstudio/sessions/{session_id}/resources' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "file",
  "file_id": "file_xxx",
  "mount_path": "/uploads/workspace/late.csv"
}
'
{
  "id": "sesrsc_xxx",
  "type": "file",
  "file_id": "file_xxx",
  "mount_path": "/mnt/session/uploads/workspace/late.csv",
  "created_at": "2026-05-28T08:25:00Z",
  "updated_at": "2026-05-28T08:25:00Z",
  "request_id": "xxx"
}

鉴权

string
header
必填

DashScope API Key

路径参数

string
必填

会话 ID,格式 sesn_<ULID>

请求体

application/json
enum<string>
必填

资源类型,固定为 file

file
string
必填

已上传的文件 ID

string
必填

挂载路径,以 /uploads 开头

响应

200-application/json
string

资源 ID,格式 sesrsc_<ULID>

string

资源类型,固定为 file

string

内部副本的文件 ID,与请求中的 file_id 不同

string

会话内的完整挂载路径

string

创建时间,ISO 8601

string

最近更新时间,ISO 8601

string

本次请求的唯一标识

运行时挂载资源 - 千问AI平台