Batch-import files from an authorized Alibaba Cloud OSS bucket. Before calling, grant Model Studio access to OSS via a service-linked role (SLR).
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/.
Before using this endpoint, grant Alibaba Cloud Model Studio access to your OSS bucket via a service-linked role (SLR). Confirm in the Alibaba Cloud RAM console that the
AliyunServiceRoleForBailian SLR has been created — otherwise the call returns a permission error.Endpoint
POST /api/v1/connector/dash/addFilesFromAuthorizedOss
Batch-import files from an authorized Alibaba Cloud OSS bucket. Before calling, grant Model Studio access to OSS via a service-linked role (SLR).
Request body
| Field | Required | Type | Description |
|---|---|---|---|
categoryId | Yes | string | Category ID. Returned by listCategory. |
categoryType | Yes | string | Category type. Defaults to UNSTRUCTURED. Enum: UNSTRUCTURED, SESSION_FILE. |
ossBucket | Yes | string | OSS bucket name. |
ossRegionId | Yes | string | OSS region, for example cn-beijing. |
fileDetails | Yes | array<object> | Files to import, 1 to 10 elements. Each element is an object with sub-fields: fileName (string, required, file name after import, 1 to 500 characters), ossKey (string, required, OSS object key (path of the file in the bucket), 1 to 256 characters), parser (string, parser type. Defaults to AUTO_SELECT. AUTO_SELECT picks a parser automatically; DOCMIND intelligent document parsing; DOCMIND_DIGITAL digital document parsing; DOCMIND_LLM_VERSION LLM-based document parsing; DASH_QWEN_VL_PARSER Qwen VL parsing (requires parserConfig); DOCMIND_LLM_VERSION_MEDIA audio and video parsing. When categoryType is UNSTRUCTURED, files are parsed according to the category's data parsing settings; when it is SESSION_FILE, the system uses its default parsing method, which cannot be changed), parserConfig (object, parser configuration. Required only when parser is DASH_QWEN_VL_PARSER; not needed for other parsers. Sub-fields: modelName (string, visual parsing model; enum qwen3-vl-plus), modelPrompt (string, parsing prompt, 1 to 1500 characters)). |
tags | No | array<string> | Tags associated with the files. Up to 10 tags. |
overWriteFileByOssKey | No | boolean | Whether to overwrite an existing file with the same ossKey. Defaults to false. |
Request example
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.
Response fields
| Field | Type | Description |
|---|---|---|
code | string | Response code. Success on success. |
message | string | Error or informational message; an empty string on success. |
requestId | string | Unique request identifier. Include this ID when reporting an issue. |
data | object | Import result. Sub-field: fileIds (array<string>, IDs of the successfully imported files). |
status | integer | Business 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 code | Error code code | Description |
|---|---|---|
| 400 | InvalidParameter | Invalid request parameters. Example message: Required parameter missing or invalid. |
| 401 | InvalidApiKey | Authentication failed; the API key is invalid or missing. Example message: Invalid API-key provided. |
status and code in the response body to determine the result.