Paginate through the chunks in a Knowledge Base.
Prerequisites
Configure the endpoint and authentication first. See API overview and Authentication.
Endpoint
POST /api/v1/indices/rag/index/chunklist
Paginate through the chunks in a specified knowledge base. In the response, data.nodes is the chunk array and data.total is the total chunk count.
docId filters chunks by document. Required for document-search and audio/video-search knowledge bases; not needed for data-query or image-QA knowledge bases.Request body
| Field | Required | Type | Description |
|---|---|---|---|
indexId | Yes | string | Knowledge base ID, the data.id returned by the createIndex API. |
pageNum | No | integer | Page number, starting from 1. Default: 1. |
pageSize | No | integer | Number of chunks returned per page. Default: 20. Maximum: 100. |
docId | No | string | Filter by document ID, returning only the chunks under that document. Document IDs can be obtained from the List Documents API. |
Request example
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.
Response fields
| Field | Type | Description |
|---|---|---|
code | string | Response code. Success on success. |
status_code | integer | HTTP status code. |
data | object | Business data. Sub-fields: total (integer, total chunk count), nodes (array<object>, chunk node list. Element fields: score (number, relevance score, usually 0 for list queries), text (string, chunk text content), metadata (object, chunk metadata. Sub-fields: _id (string, globally unique chunk identifier), doc_id (string, ID of the document the chunk belongs to), doc_name (string, name of the document), title (string, chunk title), hier_title (string, hierarchical title — the title path separated by |), content (string, chunk content), doc_url (string, original document access URL), file_path (string, OSS path of the chunk parsing output), image_url (array<string>, image URLs associated with the chunk), _chunk_id (integer, chunk sequence number within the document), _block_id (integer, block sequence number), pipeline_id (string, ID of the knowledge base), workspace_id (string, ID of the workspace), _chunk_status (integer, chunk processing status code; 0 indicates success), _chunk_status_message (string, chunk processing status description), is_displayed_chunk_content (boolean, whether the chunk participates in knowledge base retrieval), nid (string, unique chunk number in the knowledge base), source (integer, chunk source type))), isDowngrade (boolean, whether retrieval downgrade occurred). |
success | boolean | Whether the request succeeded. |
message | string | Response message. |
request_id | string | Unique request identifier. Provide this ID when troubleshooting. |
status | string | Request status. SUCCESS on success. |