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

# List Folders Handler

> List child folders of a parent folder.

Returns only direct child folders (depth=1) of the specified parent.
If parent_path_part_id is not provided, lists top-level folders.

At root level, the /users folder is hidden and replaced with the current
user's personal folder (/users/{user_id}) displayed as "Private".



## OpenAPI

````yaml /openapi.yaml get /v1/folders
openapi: 3.1.0
info:
  title: Knowledge Stack API
  description: Knowledge Stack backend API for authentication and knowledge management
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Knowledge Stack API local dev server
security: []
tags:
  - name: auth
    description: Authentication and identity management
  - name: users
    description: User accounts
  - name: tenants
    description: Tenant management
  - name: invites
    description: Tenant invitations
  - name: folders
    description: Folder management
  - name: documents
    description: Document management
  - name: document-versions
    description: Document version management
  - name: sections
    description: Document sections
  - name: chunks
    description: Chunk CRUD and semantic search
  - name: chunk-lineages
    description: Chunk lineage tracking
  - name: tags
    description: Tag management
  - name: path-parts
    description: Path part traversal and tagging
  - name: Threads
    description: Thread conversations
  - name: Thread Messages
    description: Thread message management
  - name: user-permissions
    description: User path permissions
  - name: workflows
    description: Ingestion workflows
paths:
  /v1/folders:
    get:
      tags:
        - folders
      summary: List Folders Handler
      description: |-
        List child folders of a parent folder.

        Returns only direct child folders (depth=1) of the specified parent.
        If parent_path_part_id is not provided, lists top-level folders.

        At root level, the /users folder is hidden and replaced with the current
        user's personal folder (/users/{user_id}) displayed as "Private".
      operationId: list_folders
      parameters:
        - name: parent_path_part_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
            nullable: true
            description: Parent PathPart ID (defaults to root)
            title: Parent Path Part Id
          description: Parent PathPart ID (defaults to root)
        - name: sort_order
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/PathOrder'
            description: 'Sort order for results (default: LOGICAL)'
            default: LOGICAL
          description: 'Sort order for results (default: LOGICAL)'
        - name: with_tags
          in: query
          required: false
          schema:
            type: boolean
            description: 'Include tags in the response (default: false)'
            default: false
            title: With Tags
          description: 'Include tags in the response (default: false)'
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Number of items per page
            default: 20
            title: Limit
          description: Number of items per page
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Number of items to skip
            default: 0
            title: Offset
          description: Number of items to skip
        - name: authorization
          in: header
          required: false
          schema:
            type: string
            nullable: true
            title: Authorization
        - name: ks_uat
          in: cookie
          required: false
          schema:
            type: string
            nullable: true
            title: Ks Uat
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_FolderResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PathOrder:
      type: string
      enum:
        - LOGICAL
        - NAME
        - UPDATED_AT
        - CREATED_AT
      title: PathOrder
      description: >-
        Ordering strategy for path traversal results.


        - LOGICAL: Use prev/next_sibling_path_part_id linked list order per
        depth level

        - NAME: Alphabetical by path_part.name (DEFAULT)

        - UPDATED_AT: By updated_at timestamp (most recent first)

        - CREATED_AT: By created_at timestamp (oldest first)
    PaginatedResponse_FolderResponse_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/FolderResponse'
          type: array
          title: Items
          description: List of items
        total:
          type: integer
          minimum: 0
          title: Total
          description: Total number of items
        limit:
          type: integer
          minimum: 1
          title: Limit
          description: Number of items per page
        offset:
          type: integer
          minimum: 0
          title: Offset
          description: Number of items to skip
      additionalProperties: false
      type: object
      required:
        - items
        - total
        - limit
        - offset
      title: PaginatedResponse[FolderResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FolderResponse:
      properties:
        part_type:
          type: string
          title: Part Type
          description: Path part type
          enum:
            - FOLDER
        id:
          type: string
          format: uuid
          title: Id
          description: Folder ID
        path_part_id:
          type: string
          format: uuid
          title: Path Part Id
          description: PathPart ID
        name:
          type: string
          title: Name
          description: Folder name
        parent_path_part_id:
          type: string
          format: uuid
          nullable: true
          title: Parent Path Part Id
          description: Parent PathPart ID
        materialized_path:
          type: string
          title: Materialized Path
          description: Full materialized path from root
        system_managed:
          type: boolean
          title: System Managed
          description: Whether this folder is system-managed
        tenant_id:
          type: string
          format: uuid
          title: Tenant Id
          description: Tenant ID
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation timestamp
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Last update timestamp
        tags:
          items:
            $ref: '#/components/schemas/TagResponse'
          type: array
          nullable: true
          title: Tags
          description: Tags attached to this folder
      additionalProperties: false
      type: object
      required:
        - part_type
        - id
        - path_part_id
        - name
        - parent_path_part_id
        - materialized_path
        - system_managed
        - tenant_id
        - created_at
        - updated_at
      title: FolderResponse
      description: Folder response model.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TagResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Tag ID
        name:
          type: string
          title: Name
          description: Tag name
        color:
          type: string
          title: Color
          description: Tag color hex
        description:
          type: string
          nullable: true
          title: Description
          description: Tag description
        tenant_id:
          type: string
          format: uuid
          title: Tenant Id
          description: Tenant ID
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation timestamp
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Last update timestamp
      additionalProperties: false
      type: object
      required:
        - id
        - name
        - color
        - tenant_id
        - created_at
        - updated_at
      title: TagResponse
      description: Tag response model.

````