English
Query Accessible Folder Codes
About 349 wordsAbout 1 min
2026-09-14
Description
Queries the list of knowledge folder codes accessible to the current user within the given knowledge spaces. Commonly used to filter the visible scope of knowledge entry lists and RAG search.
Request Specification
HTTP Method: POST + application/json
Request Path: https://${Cloud Domain}/cgi/crm/v2/knowledge/folder/accessibleCodes?thirdTraceId=${Random String}
Request Headers: Refer to Common Parameters
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| data | Map | Yes | Data |
| spaceIds | List[String] | Yes | List of knowledge space IDs; multiple spaces are supported in one call. The field must be present in the request body: omit it or pass null and the call returns a parameter error; pass [] to return every folder accessible (VIEW or above) to the current user across the tenant, including folders granted at folder level only without space-level permission |
Request Example
{
"data": {
"spaceIds": ["space-001", "space-002"]
}
}Response Parameters
| Parameter | Type | Description |
|---|---|---|
| traceId | string | Unique request ID |
| errorDescription | string | Error description |
| errorMessage | string | Error message |
| errorCode | Int | Error Codes |
| data | object | Response data |
| folderCodes | List[String] | Flat list of knowledge folder codes accessible to the current user |
Response Example
{
"traceId": "E-O.fktest4234.1000-20260914114000-xxxxxx",
"errorDescription": "success",
"errorMessage": "success",
"errorCode": 0,
"data": {
"folderCodes": ["16", "17", "18"]
}
}Notes
- The result is a flat list across spaces and levels, containing only folders accessible to the current user (
VIEWor above); no hierarchy is included. spaceIdsmust not be omitted: a request body without the field (or an open-platform mapping that does not fill it) returns a parameter error. Omitting the field and passing[]are different: the former is a parameter error; the latter is a tenant-wide query.minPermissionin the request body is ignored even if present; this API does not filter by that field.- The returned codes can be used directly as
INfilter values on thecategoryfield of List Knowledge Entries, or as thefoldersparameter of RAG Knowledge Search. - Do not use the message field in the response for logical judgment, as errorMessage may change.
