Delete Chunks
Updated at:
Delete chunks in batch — up to 10 per call.
Prerequisites
Configure the endpoint and authentication first. See API overview and Authentication.
Endpoint
POST /api/v1/indices/rag/index/chunk/delete
Delete chunks from a specified knowledge base in batch, up to 10 per call.
WarningThis operation is irreversible. Deleted chunks cannot be recovered. A single call accepts up to 10 chunks.
Request body
| Field | Required | Type | Description |
|---|---|---|---|
pipelineId | Yes | string | Knowledge base ID. |
chunkIds | Yes | array<string> | List of chunk IDs to delete, up to 10 per call. |
Request example
curl -X POST "$BASE_URL/api/v1/indices/rag/index/chunk/delete" \
-H "Authorization: Bearer $BAILIAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pipelineId": "your_index_id",
"chunkIds": ["chunk_abc123", "chunk_def456"]
}'
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",
"status_code": 200,
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Response fields
| Field | Type | Description |
|---|---|---|
code | string | Response code. Success on success. |
status_code | integer | HTTP status code. |
request_id | string | Unique request identifier. Provide this ID when troubleshooting. |
data | object | Returned as an empty object when the operation succeeds. |
success | boolean | Whether the operation succeeded. |
message | string | Response message. success on success. |
status | string | Request status: SUCCESS or FAILED. |
Error codes
| HTTP status code | Error code | Message | Description |
|---|---|---|---|
| 400 | Index.InvalidParameter | Required parameter missing or invalid. | Invalid request parameters. |
| 401 | InvalidApiKey | Invalid API-key provided. | Authentication failed. The API key is invalid or missing. |
Is this page helpful?