Query the knowledge base list¶
Query the knowledge base metadata of the current workspace and filter by status, source, visible range, index status, owner or keywords.
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/knowledge-bases
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and target workspace ID that can access the target workspace.
Request parameters¶
curl --get "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/knowledge-bases" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "status=active" \
--data-urlencode "index_status=ready" \
--data-urlencode "query=产品" \
--data-urlencode "limit=20"
Path parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID must be consistent with X-Workspace-ID. |
Query parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
status. Allowed: |
|
string |
No |
Source type. Allowed: |
|
string |
No |
Visible range. Allowed: |
|
string |
No |
Index status. Allowed: |
|
string |
No |
Filter by owner user ID. |
|
string |
No |
Filter by keyword. |
|
integer |
No |
Single return quantity. When it is not provided or is less than or equal to 0, it is 50, and the maximum is 200. |
|
integer |
No |
Returns the offset. 0 when not provided or less than 0. |
Status, source, visible range, and index status are stripped of leading and trailing whitespace and converted to lowercase. query does case-insensitive literal inclusion matching by name and description, % and _ are not used as wildcards. The results are sorted by update time in descending order and ID in ascending order.
Successful response¶
{
"code": 0,
"data": {
"items": [
{
"id": "kb_01",
"workspace_id": "ws_01",
"name": "产品文档",
"status": "active",
"source_type": "catalog_resource",
"visibility": "workspace",
"index_status": "ready",
"version": 1,
"created_at": "2026-08-18T01:00:00Z",
"updated_at": "2026-08-18T01:00:00Z"
}
],
"total": 1,
"limit": 20,
"offset": 0
}
}
Returns 200 on success. data.items is the knowledge base of this page, and data.total is the total number of filtered results. When there is no match, data.items returns [].
Field |
Type |
Description |
|---|---|---|
|
integer |
0 on success. |
|
array or null |
List of knowledge bases on this page. May be |
|
integer |
The total number of knowledge bases that meet the filter conditions. |
|
integer |
The paging value actually used this time. |
|
integer |
The paging value actually used this time. |
|
string |
knowledge base ID. |
|
string |
The workspace ID to which it belongs. |
|
string |
Name and description. Does not return if description is not set. |
|
string |
Name and description. Does not return if description is not set. |
|
string |
knowledge base status and source type. |
|
string |
knowledge base status and source type. |
|
array |
Related assets. Does not return if not set. For member description, see Create the associated asset field in the knowledge base. |
|
string |
Configuration references are retrieved by default. Does not return if not set. |
|
array of string |
label. Does not return if not set. |
|
string |
Owner user ID. Does not return if not set. |
|
string |
Visible range and index status. |
|
string |
Visible range and index status. |
|
string |
Last index time and error message. Does not return if not set. |
|
string |
Last index time and error message. Does not return if not set. |
|
integer |
Resource version. |
|
object |
Extended tags, annotations and metadata. Does not return if not set. |
|
object |
Extended tags, annotations and metadata. Does not return if not set. |
|
object |
Extended tags, annotations and metadata. Does not return if not set. |
|
string |
Creator and last updated ID. Does not return if not set. |
|
string |
Creator and last updated ID. Does not return if not set. |
|
string |
Creation and last update times, in RFC 3339 format. |
|
string |
Creation and last update times, in RFC 3339 format. |
Error response¶
{
"code": 2,
"message": "invalid knowledge base metadata"
}
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |