Query knowledge base details

Read the complete metadata of a knowledge base, including associated assets, index status, and versions.

HTTP
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/knowledge-bases/{knowledge_base_id}

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. First query the agent knowledge base list to obtain the knowledge base ID. Prepare a personal access token and target workspace ID that can access the target workspace.

Request parameters

Shell
curl "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/knowledge-bases/$KNOWLEDGE_BASE_ID" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

Field

Type

Required

Description

workspace_id

string

Yes

The current workspace ID must be consistent with X-Workspace-ID.

knowledge_base_id

string

Yes

The knowledge base ID to view.

Successful response

JSON
{
  "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"
  }
}

Returns 200 on success. data is knowledge base metadata.

Field

Type

Description

code

integer

0 on success.

data.id

string

knowledge base ID.

data.workspace_id

string

The workspace ID to which it belongs.

data.name

string

Name and description. Does not return if description is not set.

data.description

string

Name and description. Does not return if description is not set.

data.status

string

knowledge base status and source type.

data.source_type

string

knowledge base status and source type.

data.catalog_asset_refs

array

Related assets. Does not return if not set. For member description, see Create the associated asset field in the knowledge base.

data.default_retrieval_profile_ref

string

Configuration references are retrieved by default. Does not return if not set.

data.tags

array of string

label. Does not return if not set.

data.owner_user_id

string

Owner user ID. Does not return if not set.

data.visibility

string

Visible range and index status.

data.index_status

string

Visible range and index status.

data.last_indexed_at

string

Last index time and error message. Does not return if not set.

data.last_index_error

string

Last index time and error message. Does not return if not set.

data.version

integer

Resource version.

data.labels

object

Extended tags, annotations and metadata. Does not return if not set.

data.annotations

object

Extended tags, annotations and metadata. Does not return if not set.

data.metadata

object

Extended tags, annotations and metadata. Does not return if not set.

data.created_by

string

Creator and last updated ID. Does not return if not set.

data.updated_by

string

Creator and last updated ID. Does not return if not set.

data.created_at

string

Creation and last update times, in RFC 3339 format.

data.updated_at

string

Creation and last update times, in RFC 3339 format.

Error response

JSON
{
  "code": 3,
  "message": "knowledge base not found"
}

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

The path parameter is invalid. Recommendation: Check the workspace ID and knowledge base ID, do not use path separators in the ID.

401

6(UNAUTHENTICATED)

Valid identity credentials are missing. Recommendation: Check the API Key.

404

3(NOT_FOUND)

The knowledge base does not exist in the current workspace. Suggestion: Check knowledge_base_id, or query the knowledge base list first.

503

15(UNAVAILABLE)

The knowledge base service is temporarily unavailable. Suggestion: Try again later.

Last updated on