cURL
Authorizations
string
header
required
DashScope API Key, obtained from the API Key page in the console.
Body
application/jsonResponse
200-application/json
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Delete a document and all of its chunks from a Knowledge Base.
curl -X POST "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/index/delete_file" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"index_id": "your_index_id",
"doc_ids": ["file_xxx"]
}'{
"code": "Success",
"status_code": 200,
"data": {
"deleted": []
},
"success": true,
"message": "success",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "SUCCESS"
}index_id and doc_ids — unlike the camelCase (indexId) used by other endpoints. Sending IndexId or indexId returns Index.InvalidParameter.When a parameter is missing, the server returns Required parameter(IndexId) missing or invalid. The IndexId in that message is the server's internal field name, not the request parameter name — still send index_id.DashScope API Key, obtained from the API Key page in the console.
Response code. Success on success.
HTTP status code.
Unique request identifier. Include this ID when reporting an issue.
Whether the operation succeeded.
Response message. success on success.
Request status: SUCCESS or FAILED.
curl -X POST "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/index/delete_file" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"index_id": "your_index_id",
"doc_ids": ["file_xxx"]
}'{
"code": "Success",
"status_code": 200,
"data": {
"deleted": []
},
"success": true,
"message": "success",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "SUCCESS"
}