Skip to main content

List Files

List files in the current Workspace. Filter by category, file name, or file ID.

Prerequisites

You have an Alibaba Cloud Model Studio API key (see the API Key page in the console) and authentication configured. For details, see RAG API overview and Authentication. Data import endpoints use the same base URL and authentication as other RAG APIs, with the path prefix /api/v1/connector/dash/.

Endpoint

POST /api/v1/connector/dash/listFile List files in the current Workspace. Filter by category, file name, or file ID.
When batch-querying with fileIds, you can pass up to 20 file IDs per call.

Request body

FieldRequiredTypeDescription
categoryIdYesstringCategory ID. Returned by listCategory.
fileNameNostringFile name without the extension. Exact match. Strip the extension when passing this parameter — for file a.md, pass a.
fileIdsNoarray<string>File IDs to look up in batch. Up to 20.
nextTokenNostringPagination cursor. Omit it on the first request; on subsequent requests pass the nextToken value returned by the previous page.
maxResultNointegerNumber of files returned per page. Defaults to 20. Note the parameter name is maxResult (singular); maxResults (plural) is silently ignored.

Request example

curl -X POST "$BASE_URL/api/v1/connector/dash/listFile" \
  -H "Authorization: Bearer $BAILIAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "categoryId": "cate_abc123"
  }'
BASE_URL is https://{workspace_id}.cn-beijing.maas.aliyuncs.com ({workspace_id} is the Workspace ID), and BAILIAN_API_KEY is your Alibaba Cloud Model Studio API key.

Response example

Returns 200 on success.
{
  "code": "Success",
  "message": "",
  "messageUnmodified": false,
  "requestId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "data": {
    "hasNext": false,
    "maxResult": 20,
    "totalCount": 1,
    "maxId": 338031,
    "fileList": [
      {
        "fileId": "file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx",
        "status": "PARSE_SUCCESS",
        "fileName": "a.md",
        "fileType": "md",
        "parser": "DASHSCOPE_DOCMIND",
        "sizeBytes": 21,
        "uploadTime": "2026-04-01 16:03:45",
        "category": "cate_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx",
        "autoId": 338031,
        "parseErrorMessage": ""
      }
    ]
  },
  "status": 200
}

Response fields

FieldTypeDescription
codestringResponse code. Success on success.
messagestringError or informational message; an empty string on success.
requestIdstringUnique request identifier. Include this ID when reporting an issue.
dataobjectQuery result. Sub-fields: fileList (array<object>, file list. Each element is an object with fields: fileId (string, file ID), fileName (string, file name), fileType (string, file type, such as pdf, md, or docx), category (string, ID of the category the file belongs to), status (string, file status, such as PARSE_SUCCESS, PARSING, or FAIL), sizeBytes (integer, file size in bytes), parser (string, parsing method, such as DASHSCOPE_DOCMIND or DOCUMENT_PARSE_LLM), uploadTime (string, upload time), parseErrorMessage (string, error message returned when parsing fails; empty on success), autoId (integer, auto-incremented ID)), hasNext (boolean, whether more pages are available), maxResult (integer, page size used for this request), totalCount (integer, total number of matching items), nextToken (string, cursor for the next page. Pass this value as nextToken in the next request to paginate).
statusintegerBusiness status code. 200 on success, 400 for failures such as invalid parameters. Note that the HTTP status code remains 200 even on failure, so rely on this field and code to determine the result.

Error codes

HTTP status codeError code codeDescription
400InvalidParameterInvalid request parameters. Example message: Required parameter missing or invalid.
401InvalidApiKeyAuthentication failed; the API key is invalid or missing. Example message: Invalid API-key provided.
On business failures the HTTP status code remains 200. Check status and code in the response body to determine the result.
Managed Agent API
Flow Agent API
Sandbox API
Long-term Memory
ParseX API
Security API
Framework Integration