Query knowledge base details¶
Read the complete metadata of a knowledge base, including associated assets, index status, and versions.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/knowledge-bases/{knowledge_base_id}
Before you call¶
First query the knowledge base list to obtain the knowledge base ID. Prepare a personal access token and target workspace ID that has access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed through theX-Workspace-IDHeader and also asworkspace_idin the path.$KNOWLEDGE_BASE_ID: ID of the knowledge base to be queried.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/knowledge-bases/$KNOWLEDGE_BASE_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID, must be consistent with |
|
string |
Yes |
The ID of the knowledge base to be queried. |
Successful response¶
Returns 200 on success. data is knowledge base metadata.
{
"code": 0,
"data": {
"id": "kb_01",
"workspace_id": "ws_01",
"name": "产品文档",
"description": "已审核的产品资料",
"status": "active",
"source_type": "catalog_resource",
"catalog_asset_refs": [
{
"type": "catalog",
"id": "cat_01",
"role": "source"
}
],
"tags": ["产品", "文档"],
"owner_user_id": "user_01",
"visibility": "workspace",
"index_status": "ready",
"last_indexed_at": "2026-08-18T01:00:00Z",
"version": 2,
"labels": {
"department": "product"
},
"created_by": "user_01",
"updated_by": "user_01",
"created_at": "2026-08-18T01:00:00Z",
"updated_at": "2026-08-18T02:00:00Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Knowledge base ID. |
|
string |
ID of the workspace to which it belongs. |
|
string |
Name and description; will not be returned if no description is set. |
|
string |
Name and description; will not be returned if no description is set. |
|
string |
Knowledge base status and source type. |
|
string |
Knowledge base status and source type. |
|
object[] |
Associated assets; not returned if not set. Each item can contain |
|
string |
Default retrieval configuration reference; does not return if not set. |
|
string[] |
Label; does not return if not set. |
|
string |
Owner user ID; not returned if not set. |
|
string |
Visible range and index status. |
|
string |
Visible range and index status. |
|
string |
Recent index time and error message; not returned if not set. |
|
string |
Recent index time and error message; not returned if not set. |
|
integer |
Resource version. |
|
object |
Extended tags, comments, and metadata; not returned if not set. |
|
object |
Extended tags, comments, and metadata; not returned if not set. |
|
object |
Extended tags, comments, and metadata; not returned if not set. |
|
string |
Creator and last updater ID; not returned if not set. |
|
string |
Creator and last updater ID; not returned if not set. |
|
string |
Creation and last update times, in RFC 3339 format. |
|
string |
Creation and last update times, in RFC 3339 format. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 3,
"message": "knowledge base not found"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The path parameter is invalid. |
Check the workspace ID and knowledge base ID and do not use path separators in the ID. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The knowledge base does not exist in the current workspace. |
Check out |
|
|
The knowledge base service is temporarily unavailable. |
Try again later. |
Follow-up operations¶
When metadata needs to be modified, call Update knowledge base.