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

# List Library Folder Structure

> Retrieves the folder structure for the library. If folderUUID is provided, returns only the direct subfolders of that folder. If folderUUID is not provided, returns the root folder structure. This endpoint supports lazy loading of folder hierarchies for workflow builders.



## OpenAPI

````yaml get /library/folders
openapi: 3.0.1
info:
  title: Attention Service V2
  description: Attention Service API V2
  termsOfService: https://www.attention.com/terms-of-use
  contact:
    name: Attention Team
    url: https://docs.attention.com/welcome
    email: support@attention.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.8.0
servers:
  - url: https://api.attention.tech/v2
security:
  - APIKeyHeader: []
paths:
  /library/folders:
    get:
      tags:
        - Library
      summary: List Library Folder Structure
      description: >-
        Retrieves the folder structure for the library. If folderUUID is
        provided, returns only the direct subfolders of that folder. If
        folderUUID is not provided, returns the root folder structure. This
        endpoint supports lazy loading of folder hierarchies for workflow
        builders.
      operationId: listLibraryFolders
      parameters:
        - name: userUUID
          in: query
          description: UUID of the user. Required to fetch folder structure.
          required: true
          schema:
            type: string
        - name: folderUUID
          in: query
          description: >-
            UUID of the folder to fetch subfolders from. If not provided,
            returns root folder structure. When provided, returns only direct
            subfolders of the specified folder.
          schema:
            type: string
        - name: myLibrary
          in: query
          description: >-
            If true, returns only the user's personal library folders. If false,
            returns organization-level library folders.
          schema:
            type: boolean
            default: false
        - name: includeHidden
          in: query
          description: If true, includes hidden folders in the response. Default is false.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Folder structure successfully retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryFolderStructureResponse'
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/LibraryFolderStructureResponse'
        '401':
          description: Authentication required. Please provide a valid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Base_401_Error'
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Base_401_Error'
        '500':
          description: Unexpected server error. Please try again later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Base_500_Error'
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Base_500_Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    LibraryFolderStructureResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/LibraryFolder'
      example:
        data:
          uuid: folder-uuid-root
          name: Sales Library
          organizationUUID: org-uuid-123
          parentUUID: ''
          path: /Sales Library
          hidden: false
          subFolders:
            - uuid: folder-uuid-sub-1
              name: Best Practices
              parentUUID: folder-uuid-root
              hidden: false
              totalElements: 15
              totalFolders: 2
          subFoldersTotal: 3
    Base_401_Error:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/BaseError'
      example:
        code: 401
        message: unauthenticated for Invalid API key
    Base_500_Error:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Error'
      example:
        code: '500'
        detail: >-
          An unexpected error occurred on the server. Please try again later or
          contact support if the problem persists.
        id: internal_server_error
        title: Internal Server Error
    Error:
      type: object
      properties:
        id:
          type: string
          description: A unique identifier for the error.
        status:
          type: string
          description: >-
            The HTTP status code applicable to this problem, expressed as a
            string value.
        code:
          type: string
          description: An application-specific error code, expressed as a string value.
        title:
          type: string
          description: A short, human-readable summary of the problem.
        detail:
          type: string
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
        source:
          type: object
          properties:
            pointer:
              type: string
            parameter:
              type: string
        meta:
          type: object
          properties: {}
      example:
        id: not_found_error
        status: '404'
        code: '404'
        title: Not Found Error
        detail: The requested resource was not found
        source:
          pointer: /data/attributes/id
    LibraryFolder:
      type: object
      properties:
        uuid:
          type: string
          description: Unique identifier of the folder
        name:
          type: string
          description: Name of the folder
        path:
          type: string
          description: Full path to the folder from root
        parentUUID:
          type: string
          description: UUID of the parent folder, empty if root
        hidden:
          type: boolean
          description: Whether the folder is hidden
        userUUID:
          type: string
          description: UUID of the user who owns this folder (for personal library folders)
        organizationUUID:
          type: string
          description: UUID of the organization this folder belongs to
        subFolders:
          type: array
          description: List of immediate subfolders
          items:
            $ref: '#/components/schemas/LibrarySubFolder'
        subFoldersTotal:
          type: integer
          description: Total number of subfolders
          format: int64
      example:
        uuid: folder-uuid-root
        name: Sales Library
        organizationUUID: org-uuid-123
        parentUUID: ''
        path: /Sales Library
        hidden: false
        userUUID: ''
        subFolders:
          - uuid: folder-uuid-sub-1
            name: Best Practices
            parentUUID: folder-uuid-root
            hidden: false
            totalElements: 15
            totalFolders: 2
        subFoldersTotal: 3
    BaseError:
      type: object
      properties:
        code:
          type: string
          description: Error code
        message:
          type: string
          description: Error message
      example:
        code: unauthorized
        message: Invalid or expired API key
    LibrarySubFolder:
      type: object
      properties:
        uuid:
          type: string
          description: Unique identifier of the subfolder
        name:
          type: string
          description: Name of the subfolder
        parentUUID:
          type: string
          description: UUID of the parent folder
        hidden:
          type: boolean
          description: Whether the subfolder is hidden
        totalElements:
          type: integer
          description: Total number of elements (snippets) in this folder
          format: int64
        totalFolders:
          type: integer
          description: Total number of nested subfolders
          format: int64
      example:
        uuid: folder-uuid-sub-1
        name: Best Practices
        parentUUID: folder-uuid-root
        hidden: false
        totalElements: 15
        totalFolders: 2
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      name: Authorization
      in: header

````