Skip to main content

List Chunks

Paginate through the chunks in a Knowledge Base.

POST
/api/v1/indices/rag/index/chunklist
cURL
curl -X POST "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/index/chunklist" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "indexId": "your_index_id",
    "pageNum": 1,
    "pageSize": 10
  }'
{
  "code": "Success",
  "status_code": 200,
  "data": {
    "total": 106,
    "nodes": [
      {
        "score": 0,
        "text": "Example chunk text content...",
        "metadata": {
          "_id": "llm-xxxxxxxxxxxx_your_kb_id_file_xxxxxxxx_0_0",
          "doc_id": "file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx",
          "doc_name": "sample_document",
          "title": "Product Overview",
          "content": "Example chunk text content...",
          "hier_title": "Product Overview|Features",
          "doc_url": "https://oss-example.aliyuncs.com/...",
          "file_path": "https://oss-example.aliyuncs.com/.../docJson/sample.json",
          "image_url": [],
          "_chunk_id": 0,
          "_block_id": 0,
          "pipeline_id": "your_kb_id",
          "workspace_id": "llm-xxxxxxxxxxxx",
          "_chunk_status": 0,
          "_chunk_status_message": "成功",
          "is_displayed_chunk_content": true
        }
      }
    ],
    "isDowngrade": false
  },
  "success": true,
  "message": "success",
  "request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "SUCCESS"
}
Page through chunks in a Knowledge Base. Specify the Knowledge Base ID via indexId in the request body. Chunks are returned as graph nodes — nodes is the chunk array and total is the total chunk count.
doc_id filters chunks by document. Required for document-search and audio/video-search KBs; not needed for data-query or image-QA KBs.

Authorizations

string
header
required

DashScope API Key, obtained from the API Key page in the console.

Body

application/json
string
required

Knowledge Base ID (same as the data.id field returned by createIndex).

integer

Page number, starting at 1. Defaults to 1.

integer

Chunks per page. Defaults to 20, max 100.

string

Filter by document ID — only return chunks under this document.

Response

200-application/json
string

Response code. Success on success.

integer

HTTP status code.

object

Response payload.

boolean

Whether the request succeeded.

string

Response message.

string

Unique request ID for troubleshooting.

string

Request status. SUCCESS on success.