> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取包含笔记数量的 Knowledge 文件夹结构。

> 返回完整的文件夹树，并包含每个文件夹中的 note 数量。

<div id="permissions">
  ## 权限
</div>

需要使用在组织级别具有 `ManageKnowledge` 权限的服务用户。


## OpenAPI

````yaml zh/v3-openapi.yaml GET /v3/organizations/{org_id}/knowledge/folders
openapi: 3.1.0
info:
  description: 采用 Service User 身份验证和 RBAC 的 Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/organizations/{org_id}/knowledge/folders:
    get:
      tags:
        - notes
      summary: 获取包含笔记数量的 Knowledge 文件夹结构。
      description: 返回完整的文件夹树，并包含每个文件夹中的 note 数量。
      operationId: handle_list_folders_v3_organizations__org_id__knowledge_folders_get
      parameters:
        - description: 组织 ID（前缀：org-）
          in: path
          name: org_id
          required: true
          schema:
            example: org-abc123def456
            title: Org Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderTreeResponse'
          description: 成功响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    FolderTreeResponse:
      description: 文件夹结构端点的响应。
      properties:
        folders:
          items:
            $ref: '#/components/schemas/FolderSummary'
          title: Folders
          type: array
        root_note_count:
          title: Root Note Count
          type: integer
      required:
        - folders
        - root_note_count
      title: FolderTreeResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    FolderSummary:
      description: Knowledge 文件夹树中的一个文件夹。
      properties:
        folder_id:
          title: Folder Id
          type: string
        name:
          title: Name
          type: string
        note_count:
          title: Note Count
          type: integer
        parent_folder_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Folder Id
        path:
          title: Path
          type: string
      required:
        - folder_id
        - name
        - path
        - note_count
      title: FolderSummary
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      description: 服务用户凭据（前缀：cog_）
      scheme: bearer
      type: http

````