All Products
Search
Document Center

PolarDB:DescribeKnowledgeBaseFiles

Last Updated:Sep 24, 2026

Queries the list of files 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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

polardb:DescribeKnowledgeBaseFiles

get

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID.

cn-beijing

KnowledgeBaseId

string

Yes

The unique identifier of the knowledge base.

pkb-xxxxx

PageNumber

integer

No

The page number.

1

PageSize

integer

No

The number of records per page.

20

SourceType

string

No

The source type.

OSS

Keyword

string

No

The keyword for the file name.

FinancialReport

FileIds

string

No

The list of file IDs, separated by commas.

doc_a,doc_b

LinkId

string

No

The unique identifier of the synchronization link.

pkbl-2ze123456789abc

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

Id of the request

CED079B7-A408-41A1-BFF1-EC608E******

PageNumber

integer

The page number.

1

PageSize

integer

The number of records per page. Valid values: 30, 50, and 100.

Default value: 30.

30

TotalRecordCount

integer

The total number of records.

9

PageRecordCount

integer

The number of records on the current page.

9

Items

array<object>

The list of files.

array<object>

The file details.

FileId

string

The file ID.

5b2dbb13-xxxx-xxxx-xxxx-a55fe8daec8f

KnowledgeSpaceId

string

The knowledge space ID.

pks-xxxxxx

KnowledgeBaseId

string

The knowledge base ID.

pkb-xxxxxx

FileName

string

The file name.

FinancialReport.pdf

OSSPath

string

The OSS file path.

oss://test-bucket-example/pks-xxxx/pkb-xxxx/FinancialReport.pdf

FileSize

integer

The file size in bytes.

318881

FileType

string

The file type.

pdf

ShardCount

integer

The number of shards.

10

ShardingStrategyConfig

object

The chunking strategy configuration currently in effect for the document. This value may be empty if the complete configuration was not saved for existing instances.

DefaultStrategy

object

The default chunking strategy type. Valid values: hybrid and hierarchical.

Type

string

The default chunking strategy type. Valid values: hybrid and hierarchical.

hybrid

Parameters

object

The parameter list.

MaxTokens

integer

The maximum number of tokens per shard.

512

MergePeers

boolean

Specifies whether to merge adjacent small shards under the same heading.

true

Rules

array<object>

The list of override rules matched in order.

array<object>

The rule details.

Match

object

The content type. Currently, table is supported.

ContentType

string

The content type. Currently, table is supported.

table

Strategy

object

The chunking strategy.

Type

string

The chunking strategy type after a rule is matched.

hierarchical

Parameters

object

The parameter list.

MaxTokens

integer

The maximum number of tokens per shard for matched content.

512

MarkdownTables

string

The Markdown table processing mode. Valid values: auto, on, and off.

auto

InheritSpaceStrategy

boolean

Indicates whether the knowledge space chunking strategy is inherited.

true

Status

string

The status.

COMPLETED

ErrorMessage

string

The error message.

Not Support.

Metadata

object

The document metadata.

{}

SourceType

string

The source type.

OSS

UploadTime

string

The upload time.

The time is in ISO 8601 format in UTC (format: YYYY-MM-DDTHH:mm:ssZ).

2026-06-15T22:28:53Z

UpdatedAt

string

The update time.

The time is in ISO 8601 format in UTC (format: YYYY-MM-DDTHH:mm:ssZ).

2026-06-15T22:28:53Z

Examples

Success response

JSON format

{
  "RequestId": "CED079B7-A408-41A1-BFF1-EC608E******",
  "PageNumber": 1,
  "PageSize": 30,
  "TotalRecordCount": 9,
  "PageRecordCount": 9,
  "Items": [
    {
      "FileId": "5b2dbb13-xxxx-xxxx-xxxx-a55fe8daec8f",
      "KnowledgeSpaceId": "pks-xxxxxx",
      "KnowledgeBaseId": "pkb-xxxxxx",
      "FileName": "Financial_report.pdf",
      "OSSPath": "oss://test-bucket-example/pks-xxxx/pkb-xxxx/Financial_report.pdf",
      "FileSize": 318881,
      "FileType": "pdf",
      "ShardCount": 10,
      "ShardingStrategyConfig": {
        "DefaultStrategy": {
          "Type": "hybrid",
          "Parameters": {
            "MaxTokens": 512,
            "MergePeers": true
          }
        },
        "Rules": [
          {
            "Match": {
              "ContentType": "table"
            },
            "Strategy": {
              "Type": "hierarchical",
              "Parameters": {
                "MaxTokens": 512,
                "MarkdownTables": "auto"
              }
            }
          }
        ]
      },
      "InheritSpaceStrategy": true,
      "Status": "COMPLETED",
      "ErrorMessage": "Not Support.",
      "Metadata": {},
      "SourceType": "OSS",
      "UploadTime": "2026-06-15T22:28:53Z",
      "UpdatedAt": "2026-06-15T22:28:53Z"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.