All Products
Search
Document Center

Tablestore:ListChunks

Last Updated:Sep 24, 2026

Use the ListChunks operation to query the list of slices of a specified document in a paginated manner.

Prerequisites

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

  • An API Key has been created.

  • The knowledge base and document to query already exist.

Request parameters

Parameter

Type

Description

knowledgeBaseName

string

The name of the knowledge base. Required.

subspace

string

The name of the subspace. Required when the subspace feature is enabled.

docId

string

The document ID. Specify either this parameter or `ossKey`.

ossKey

string

The OSS path. Specify either this parameter or `docId`.

maxResults

int

The number of entries to return. Default: 10. Maximum: 1000.

nextToken

string

The pagination token.

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>/ListChunks \
  -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",
  "ossKey": "oss://example-bucket/docs/manual.pdf",
  "maxResults": 10
}'

Response

Field

Type

Description

chunkDetails[].subspace

string

The subspace to which the slice belongs.

chunkDetails[].chunkId

int

The slice ID.

chunkDetails[].content

string

The slice content.

chunkDetails[].title

string

The slice title.

chunkDetails[].chunkType

string

The slice type, such as `TEXT`.

chunkDetails[].status

string

`active` (retrievable) or `inactive` (not retrievable).

chunkDetails[].docId

string

The ID of the document to which the slice belongs.

chunkDetails[].ossKey

string

The OSS path of the document to which the slice belongs.

chunkDetails[].createdAt

int

The creation timestamp.

chunkDetails[].updatedAt

int

The update timestamp.

nextToken

string

The pagination token. An empty value indicates the last page.

{
    "code": "SUCCESS",
    "data": {
        "chunkDetails": [
            {
                "subspace": "default",
                "docId": "fc6ed97f-28ad-4dc0-9b73-bf4a7d67ab65",
                "ossKey": "oss://example-bucket/docs/manual.pdf",
                "chunkId": 0,
                "content": "Product installation steps: 1. Download and extract the installation package. 2. Follow the installation wizard to complete the installation. 3. Launch the product and verify that the installation success page is displayed.",
                "title": "Product installation steps",
                "chunkType": "TEXT",
                "status": "active",
                "createdAt": 1787636596495
            }
        ],
        "nextToken": ""
    },
    "message": "succeed"
}