Skip to main content

Upload File

Uploads a single file using multipart/form-data, with a maximum size of 50 MB. The file enters a security review after upload; only files with available status can be mounted or used as message content.

Prerequisites

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

Quotas and limits

  • Total file storage per workspace is limited to 100 GB.
  • Files are retained for 30 days. Files older than 30 days are not guaranteed to be available and may be automatically cleaned up. Re-upload periodically for long-term retention.
  • Maximum size for a single file uploaded via this endpoint is 50 MB.

Endpoint

POST /files Uses multipart/form-data encoding. filename is automatically extracted from the form part, and mime_type is detected by the server.

Request example

curl -X POST "$AGENTSTUDIO_URL/files" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -F "file=@./sales_2025.csv"

Response example

{
  "id": "file_xxx",
  "type": "file",
  "filename": "sales_2025.csv",
  "downloadable": false,
  "mime_type": "text/csv",
  "size_bytes": 524288,
  "status": "checking",
  "created_at": "2026-06-16T14:51:39+08:00",
  "requestId": "xxx"
}
The response is a File object. Fields are as follows:

Response fields

FieldTypeDescription
idstringFile ID, format file_<24 alphanumeric> (e.g. file_maznwes8t9rsysg5r5enkvpr)
typestringFixed value file
filenamestringFilename (parsed from the upload form part)
mime_typestringMIME type detected by the server
size_bytesintFile size in bytes
downloadableboolWhether the file supports download. Both direct uploads and session sandbox copies are false
statusstringSecurity review status: available (passed, can be mounted) / checking (under review) / rejected (content rejected) / type_rejected (unsupported type). Newly uploaded files default to checking
created_atstringUpload time, ISO 8601
requestIdstringUnique identifier for this request

Scope

Files from regular uploads have no scope field (shared within the workspace by default). When a file is mounted to a session sandbox, the server creates an internal copy with a new file_id; the metadata of this copy includes scope: {"type": "session", "id": "sesn_..."}, making it visible only to the corresponding session.
Managed Agent API
Flow Agent API
Sandbox API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration