All Products
Search
Document Center

Tablestore:Delete documents

Last Updated:Sep 24, 2026

Use the DeleteDocuments operation to delete specified documents and all their chunks. The response data.documentDetails returns per-item results. An HTTP 200 status with code SUCCESS does not indicate that all documents were deleted successfully; you must check the status of each item (succeed or failed), and inspect failureReason for any failed items.

Prerequisites

  • An AgentStorage instance has been created and is in the normal state, and the instance endpoint and instance name have been obtained.

  • An API Key has been created.

  • The documents to delete already exist. Deletion is irreversible.

Request parameters

Parameter

Type

Description

knowledgeBaseName

string

Knowledge base name (required)

subspace

string

Subspace name. Required when subspace is enabled

documents

list<object>

The list of documents to delete (required). A maximum of 10 items per request by default

documents[].docId

string

Document ID. Mutually exclusive with ossKey

documents[].ossKey

string

OSS path. Mutually exclusive with docId

Request example

When authenticating with an API Key, pass the instance name and API Key through the x-ots-instancename and x-ots-apikey request headers.

curl -X POST https://<endpoint>/DeleteDocuments \
  -H "x-ots-instancename: <instance-name>" \
  -H "x-ots-apikey: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
  "knowledgeBaseName": "product_docs_kb",
  "subspace": "default",
  "documents": [
    {"ossKey": "oss://example-bucket/docs/manual.pdf"}
  ]
}'

Response

{"code":"SUCCESS","data":{"documentDetails":[{"ossKey":"oss://example-bucket/docs/manual.pdf","status":"succeed"}]},"message":"succeed"}