All Products
Search
Document Center

AI Coding Assistant Lingma:List knowledge bases

Last Updated:Mar 27, 2026

Retrieves a list of Lingma knowledge bases.

Supported editions

Enterprise Dedicated Edition

Service endpoints

Get the service endpoint and replace {domain} in the API request syntax with your endpoint .

Authorization

Product

Resource

Required permission

Lingma

knowledge base

Read-only

Request syntax

GET https://{domain}/oapi/v1/lingma/organizations/{organizationId}/knowledgeBases

Request

All knowledge bases

curl -X 'GET' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/lingma/organizations/6826e1d0516a9f85a08c****/knowledgeBases' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Search by name

curl -X 'GET' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/lingma/organizations/6826e1d0516a9f85a08c****/knowledgeBases?query=t' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Filter by scenario type

curl -X 'GET' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/lingma/organizations/6826e1d0516a9f85a08c****/knowledgeBases?sceneType=chat' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Request headers

x-yunxiao-token string (Required)

The access token. See Access token for details.

Example: pt-0fh3****0fbG_35af****0484.

Request parameters

organizationId string (Required)

The organization ID. You can obtain the organization ID from the Basic Information page in the Admin Console.

query string (Optional)

A keyword for a fuzzy search by knowledge base name.

sceneType string (Optional)

The scenario type. Valid values:

  • chat: The chat scenario.

  • complement: The code completion scenario. If you do not specify the sceneType parameter, knowledge bases for all scenario types are returned.

orderBy string (Optional)

The field to sort the results by. Valid values:

  • name: Knowledge base name.

  • sceneType: Knowledge base scenario type.

  • size: Knowledge base size.

  • fileCount: The number of files in the knowledge base.

  • lastActivityTime: The last activity time.

  • gmtCreate: The creation time.

sort string (Optional)

The sorting order. Valid values:

  • desc: Descending order.

  • asc: Ascending order.

userId string (Optional)

Specify a user ID to return only knowledge bases accessible to that user. If omitted, all knowledge bases in the organization are returned.

page integer (Optional) Default: 1

The page number.

perPage integer (Optional) Default: 20

The number of entries to return per page. Valid values: 1 to 20.

Response parameters

Response example

[
    {
        "accessLevel": 10,
        "creator": {
            "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/113iaf62a4481af4cd44ad46d8c3e9b55851/w/100/h/100",
            "displayName": "fangqian_testcloud_com",
            "id": "66a6f60e368d88cff5a513fc",
            "userName": "test"
        },
        "description": "",
        "fileCount": 0,
        "gmtCreate": 1749712990396,
        "gmtModified": 1749712990396,
        "id": "7d9800958eabaa982de687c8",
        "lastActivityTime": 1749712990396,
        "memberCount": 1,
        "name": "test",
        "organizationId": "6826e1d0516a9f85a08cb522",
        "sceneType": "chat",
        "size": "0 B",
        "state": "disable"
    }
]

accessLevel integer

The visibility of the knowledge base. Valid values:

  • 0: A private knowledge base.

  • 10: A public knowledge base.

creator object

The user who created the knowledge base.

Properties

avatarUrl string

The URL of the creator's avatar.

displayName string

The display name of the creator.

id string

The ID of the creator.

userName string

The username of the creator.

description string

The description of the knowledge base.

fileCount integer

The number of files in the knowledge base.

gmtCreate integer

The creation time, as a UNIX timestamp in milliseconds.

gmtModified integer

The modification time, as a UNIX timestamp in milliseconds.

id string

The ID of the knowledge base.

lastActivityTime integer

The last activity time, as a UNIX timestamp in milliseconds.

memberCount integer

The number of members in the knowledge base.

name string

The name of the knowledge base.

organizationId string

The ID of the organization to which the knowledge base belongs.

sceneType string

The scenario type of the knowledge base. Valid values:

  • chat: The chat scenario.

  • complement: The code completion scenario.

size string

The size of the knowledge base.

state string

The status of the knowledge base. Valid values:

  • enable: The knowledge base is active.

  • disable: The knowledge base is inactive.

Response headers

Parameter

Description

Example

x-next-page

The next page number.

1

x-page

The current page number.

1

x-per-page

The number of entries per page.

20

x-prev-page

The previous page number.

1

x-total

The total number of entries.

9

x-total-pages

The total number of pages.

1

Error codes

For more information, see Error codes.