Create Session Resource

Updated at:

Mounts a file dynamically during a running session. The server creates an internal copy of the file and prefixes the mount path with /mnt/session/uploads/. This operation does not produce session events.

Prerequisites

Endpoint and authentication configured. For details, see Overview and authentication.

Endpoint

POST /sessions/{session_id}/resources

Path parameters

FieldRequiredTypeDescription
session_idYesstringSession ID, format sesn_<ULID>

Request body

FieldRequiredTypeDescription
typeYesstringResource type, always file
file_idYesstringID of the uploaded file
mount_pathYesstringMount path, starting with /uploads

Request example

curl -X POST "$AGENTSTUDIO_URL/sessions/sesn_xxx/resources" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "file",
    "file_id": "file_xxx",
    "mount_path": "/uploads/workspace/late.csv"
  }'

Response example

{
  "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"
}

Response fields

FieldTypeDescription
idstringResource ID, format sesrsc_<ULID>
typestringResource type, always file
file_idstringFile ID of the internal copy; differs from the file_id in the request
mount_pathstringFull mount path within the session
created_atstringCreation time, ISO 8601
updated_atstringLast update time, ISO 8601
request_idstringUnique request identifier

Error codes

HTTP statusError codeDescription
400InvalidParameterRequired parameter missing or invalid
401InvalidApiKeyInvalid API key provided