Skip to main content

Batch Update File Tags

Batch update tags for multiple files, supporting both overwrite and append modes

POST
/api/v1/connector/dash/batchUpdateFileTag
cURL
curl -X POST "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/connector/dash/batchUpdateFileTag" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fileInfos": [
      {"fileId": "file_abc123", "tags": ["产品", "V2"]},
      {"fileId": "file_def456", "tags": ["FAQ"]}
    ],
    "updateMode": "OVERWRITE"
  }'
{
  "code": "Success",
  "status_code": 200,
  "data": {},
  "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
The two modes for updateMode: OVERWRITE replaces all existing tags on the file; APPEND adds new tags to the existing ones.

Authorizations

string
header
required

DashScope API Key,在控制台 API Key 页面 获取。

Body

application/json
object[]
required

文件标签信息列表。

items: 1–20
enum<string>

更新模式:OVERWRITE(覆盖现有标签)、APPEND(追加标签)。

OVERWRITE,APPEND

Response

200-application/json
string

响应码,成功时为 Success。

string

错误或提示信息,成功时为空字符串。

string

请求唯一标识,排查问题时请提供此 ID。

object

逐个文件的更新结果。

integer

业务状态码。成功为 200,参数错误等失败场景为 400。注意失败时 HTTP 状态码仍为 200,需根据本字段与 code 判断结果。