List Files

Updated at:

Lists files in the workspace with pagination, sorted by created_at in descending order. Use scope_id to list only files within a specific session sandbox.

Prerequisites

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

Endpoint

GET/files

Query parameters

limitintOptionalDefault 20

Number of items per page, maximum 100

pagestringOptionalDefault —

Omit on the first call; pass next_page from the previous response for subsequent calls

scope_idstringOptionalDefault —

Pass a session ID to list only files within that session sandbox

Request example

curl "$AGENTSTUDIO_URL/files?limit=20" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"
import os
import dashscope

client = dashscope.Client(api_key=os.getenv('DASHSCOPE_API_KEY'))

# List uploaded files (page_no is the page number, page_size is the number of items per page)
result = client.files.list(page_no=1, page_size=10)
print(result.files)
CursorPage<AgentStudioFile> page = client.files().list(
    FileListParam.builder().limit(20).build());
for (AgentStudioFile f : page.getData()) {
    System.out.println(f.getId() + " " + f.getFilename() + " " + f.getSizeBytes());
}

Response example

{
  "data": [
    {
      "id": "file_xxx",
      "type": "file",
      "filename": "sales_2025.csv",
      "downloadable": false,
      "mime_type": "text/csv",
      "size_bytes": 524288,
      "status": "available",
      "created_at": "2026-06-16T14:51:39+08:00"
    },
    {
      "id": "file_xxx",
      "type": "file",
      "filename": "demo.png",
      "downloadable": false,
      "mime_type": "image/png",
      "size_bytes": 102400,
      "status": "checking",
      "created_at": "2026-06-16T14:48:02+08:00"
    }
  ],
  "next_page": "xxx",
  "requestId": "xxx"
}

The response contains data (an array of File objects) and next_page. File object fields are as follows:

Response fields

dataarray<File>

Array of File objects

data[] File object fields

idstring

File ID, format: file_<24 alphanumeric>

typestring

Fixed value file

filenamestring

Filename

mime_typestring

MIME type detected by the server

size_bytesint

File size in bytes

downloadablebool

Whether the file supports download; both direct uploads and session sandbox copies are false

statusstring

Security review status: available / checking / rejected / type_rejected

created_atstring

Upload time, ISO 8601

next_pagestring / null

Cursor for the next page; absent or null when there is no more data

requestIdstring

Unique identifier for this request