All Products
Search
Document Center

Tablestore:UpdateChunks

Last Updated:Sep 24, 2026

Use the UpdateChunks operation to batch update the title, content, or status of slices. Batch requests may partially succeed. You must check the updateStatus field (succeed or failed) in data.updateDetails for each item. If an item fails, view the failureReason field.

Prerequisites

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

  • An API Key has been created.

  • The knowledge base and document to which the slices to be updated belong already exist.

Request parameters

Parameter

Type

Description

knowledgeBaseName

string

The name of the knowledge base. Required.

subspace

string

The subspace name. Required when subspace is enabled.

chunks

list<object>

The list of slices to update. Required. Maximum 10 per request.

chunks[].docId

string

The document ID. Either this or `ossKey` must be specified.

chunks[].ossKey

string

The OSS path. Either this or `docId` must be specified.

chunks[].chunkId

int

The slice ID. Required.

chunks[].title

string

The updated title. Maximum 100 tokens.

chunks[].content

string

The updated content. Maximum 512 tokens by default, calculated based on the server-side token count. If the instance has a custom quota configuration, the actual configuration applies.

chunks[].status

string

The status to set: `active` (retrievable) or `inactive` (not retrievable).

Request example

When you use API Key authentication, pass the instance name and API Key through the x-ots-instancename and x-ots-apikey request headers.

curl -X POST https://<endpoint>/UpdateChunks \
  -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",
  "chunks": [
    {"ossKey": "oss://example-bucket/docs/manual.pdf", "chunkId": 0, "status": "inactive"},
    {"ossKey": "oss://example-bucket/docs/manual.pdf", "chunkId": 1, "title": "更新后的标题", "content": "更新后的内容"}
  ]
}'

Response

Field

Type

Description

updateDetails[].docId

string

The document ID.

updateDetails[].ossKey

string

The OSS path.

updateDetails[].chunkId

int

The slice ID.

updateDetails[].updateStatus

string

succeed` or `failed

updateDetails[].failureReason

string

The failure reason. Returned only when the status is failed.