All Products
Search
Document Center

Data Management:ListDocuments

Last Updated:May 18, 2026

Lists the documents in a knowledge base.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

KbUuid

string

Yes

The ID of the knowledge base.

kb-***

NextToken

string

No

The pagination token to retrieve the next page of results. Omit this parameter to retrieve the first page. A NextToken value in the response indicates that more results are available. To fetch the next page, pass this value in a subsequent request. A null value indicates that all results have been retrieved.

zCXSmY0CJbybp6FZV7vo0Wjw64X-*****

MaxResults

integer

No

The maximum number of documents to return per page.

Valid values: 1 to 100.

Default value: 20.

20

NamePattern

string

No

The document name filter. Returns only documents whose names contain this value.

test

SortFieldName

string

No

The sort field. Valid values:

  • id (default): The document ID.

  • hits: The number of hits.

  • modifyTime: The modification time.

hits

SortOrder

string

No

The sort order. Valid values:

  • ASC (default): Sorts in ascending order.

  • DESC: Sorts in descending order.

DESC

Filters

string

No

The document property filter. The following properties are supported:

  • fileExt: The document extension.

  • state: The document status.

{"fileExt":"pdf","state":0}

Response elements

Element

Type

Description

Example

object

The response structure.

RequestId

string

The unique request ID. Use this ID to troubleshoot issues.

67E910F2-4B62-5B0C-ACA3-7547695C****

TotalCount

integer

The total number of documents that meet the specified criteria. This parameter is not currently supported and always returns 0.

0

Data

array

A list of documents.

OneMetaKnowledgeBaseDocument

The response structure.

NextToken

string

The pagination token.

zCXSmY0CJbybp6FZV7vo0Wjw64X-*****

MaxResults

integer

The page size.

20

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

ErrorCode

string

The error code, returned only when the request fails.

KnowledgeBaseNotFound

ErrorMessage

string

The error message, returned only when the request fails.

Resource not found kb-***

Examples

Success response

JSON format

{
  "RequestId": "67E910F2-4B62-5B0C-ACA3-7547695C****",
  "TotalCount": 0,
  "Data": [
    {
      "KbUuid": "",
      "Name": "",
      "Description": "",
      "FileExt": "",
      "DocumentLoaderName": "",
      "TextSplitterName": "",
      "GmtCreate": "",
      "GmtModified": "",
      "FileSize": 0,
      "DocsCount": 0,
      "State": 0,
      "Summary": "",
      "Keywords": ""
    }
  ],
  "NextToken": "zCXSmY0CJbybp6FZV7vo0Wjw64X-*****",
  "MaxResults": 20,
  "Success": true,
  "ErrorCode": "KnowledgeBaseNotFound",
  "ErrorMessage": "Resource not found kb-***"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.