Skip to main content

List Documents

List the documents in a Knowledge Base.

GET
/api/v1/indices/rag/index/files
cURL
curl -G "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/index/files" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -d "index_id=your_index_id" \
  -d "page_num=1" \
  -d "page_size=20"
{
  "code": "Success",
  "status_code": 200,
  "data": {
    "page_number": 1,
    "total_count": 1,
    "rows": [
      {
        "code": "FINISH",
        "connectorId": "conn_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx",
        "dataSync": false,
        "doc_type": "md",
        "gmt_modified": 1782184640000,
        "message": "Index build succeeded",
        "doc_id": "file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx",
        "categoryName": "Default category",
        "tags": [],
        "ingestion_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "size": 21,
        "doc_name": "a",
        "canDelete": true,
        "source_id": "cate_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx",
        "meta_extract_info": [],
        "categoryId": "cate_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxx",
        "status": "FINISH"
      }
    ],
    "page_size": 1
  },
  "success": true,
  "message": "success",
  "request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "SUCCESS"
}

Authorizations

string
header
required

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

Query Parameters

string
required

Knowledge Base ID — the pipelineId returned when the Knowledge Base was created.

length >= 1
integer
default1

Page number, starting at 1.

x >= 1
integer
default20

Documents per page.

1 <= x <= 100

Response

200-application/json
string

Response code. Success on success.

integer

HTTP status code.

string

Unique request identifier. Include this ID when reporting an issue.

object
boolean

Whether the request succeeded.

string

Informational message; success on success.

string

Request status: SUCCESS or FAILED.