Skip to main content

Register File

Final step of the upload flow — register an OSS-uploaded file with the data center.

POST
/api/v1/connector/dash/addFile
cURL
curl -X POST "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/connector/dash/addFile" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "leaseId": "lease_abc123",
    "category": "cate_abc123",
    "categoryType": "UNSTRUCTURED",
    "parser": "AUTO_SELECT",
    "tags": ["product", "guide"]
  }'
{
  "code": "Success",
  "status_code": 200,
  "data": {
    "fileId": "file_abc123"
  },
  "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
The category ID parameter is named category, not categoryId. This differs from listFile, addFilesFromAuthorizedOss, and other endpoints that use categoryId — don't confuse the two.

Authorizations

string
header
required

DashScope API Key, obtained from the API Key page in the console.

Body

application/json
string
required

Upload lease ID, the leaseId returned by the applyFileUploadLease endpoint.

string
required

Category ID (the field is named category, not categoryId). Returned by listCategory.

enum<string>
required

Parser type. 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.

AUTO_SELECT,DOCMIND,DOCMIND_DIGITAL,DOCMIND_LLM_VERSION,DASH_QWEN_VL_PARSER,DOCMIND_LLM_VERSION_MEDIA
enum<string>
default"UNSTRUCTURED"

Category type.

UNSTRUCTURED,SESSION_FILE
string[]

Tags associated with the file. Empty by default (no tags). Up to 100 tags; the total length of all tags must not exceed 700 characters; each tag is at most 64 characters.

items: 1–100
string

Associates a URL with the file. When building a document-search Knowledge Base, the platform records this link and returns it with the file's recall results during agent conversations (via the docUrl field). The agent application must have the Knowledge Base enabled and answer-source display turned on, otherwise this parameter has no effect.

object

Parser configuration. Required only when parser is DASH_QWEN_VL_PARSER; not needed for other parsers.

Response

200-application/json
string

Response code. Success on success.

integer

Response status code.

string

Error or informational message; an empty string on success.

string

Unique request identifier. Include this ID when reporting an issue.

object
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.