Use the ListKnowledgeBase interface to paginate through all knowledge bases under the current Project.
Prerequisites
-
An AgentStorage instance has been created and is in the
normalstate, and the instance endpoint and instance name have been obtained. -
An API Key has been created.
Request parameters
|
Parameter |
Type |
Description |
|
|
int |
The number of results to return. Default: 10. Maximum: 100. |
|
|
string |
The pagination token. Omit this parameter in the first request. |
Request example
When you use API Key authentication, pass the instance name and API Key through the x-ots-instancename and x-ots-apikey request headers.
curl -X POST https://<endpoint>/ListKnowledgeBase \
-H "x-ots-instancename: <instance-name>" \
-H "x-ots-apikey: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{"maxResults": 10}'
Response
|
Field |
Type |
Description |
|
|
list<object> |
The list of knowledge bases. Each item contains |
|
|
string |
The pagination token. An empty value indicates that the last page has been reached. |
{
"code": "SUCCESS",
"data": {
"knowledgeBases": [
{
"knowledgeBaseName": "product_docs_kb",
"description": "Product documentation knowledge base",
"subspace": true,
"tags": ["Product", "Documentation"],
"createdAt": 1787636583092,
"updatedAt": 1787636583092
}
],
"nextToken": ""
},
"message": "succeed"
}