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

> List the files in a knowledge base folder

# List Knowledge Folder Files



## OpenAPI

````yaml get /v1/knowledge/{knowledge_id}/files
openapi: 3.1.0
info:
  title: spectra-server
  description: The API for Spectra Backend.
  version: 0.1.0
servers:
  - url: https://api-spectra.duplik.cn
security: []
paths:
  /v1/knowledge/{knowledge_id}/files:
    get:
      tags:
        - Knowledge
      summary: List Knowledge Folder Files
      description: >-
        List files in one folder. Only the current level is returned;
        sub-folders are not traversed. When `folder_id` is omitted, files in the
        root folder are returned.


        Each item carries `file` (the file itself) and `document` (the matching
        document with its parsing progress). Use `file_name` for a fuzzy match
        and `process_status` (comma separated) to filter by parsing state.
      operationId: list_knowledge_folder_files_v1_knowledge__knowledge_id__files_get
      parameters:
        - name: knowledge_id
          in: path
          required: true
          schema:
            type: string
            title: Knowledge Id
            description: Knowledge base ID
          description: Knowledge base ID
        - name: page_num
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page Num
            description: Page number
          description: Page number
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 10
            title: Page Size
            description: Page size
          description: Page size
        - name: folder_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Folder Id
            description: >-
              Folder ID. Omit to list the root folder; multiple IDs can be
              passed comma separated
          description: >-
            Folder ID. Omit to list the root folder; multiple IDs can be passed
            comma separated
        - name: file_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: File Name
            description: Fuzzy match on file name
          description: Fuzzy match on file name
        - name: process_status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Process Status
            description: Filter by parsing state, comma separated, e.g. 200
          description: Filter by parsing state, comma separated, e.g. 200
        - name: status
          in: query
          required: false
          schema:
            type: array
            items:
              type: integer
              enum:
                - 0
                - 1
                - 2
            title: Status
            description: >-
              Filter by file status; repeat the parameter to pass several. 1 =
              enabled, 2 = disabled, 0 = deleted. Defaults to enabled + disabled
          description: >-
            Filter by file status; repeat the parameter to pass several. 1 =
            enabled, 2 = disabled, 0 = deleted. Defaults to enabled + disabled
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeFilePagination'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      security:
        - HTTPBearer: []
components:
  schemas:
    KnowledgeFilePagination:
      properties:
        total_count:
          type: integer
          title: Total Count
          default: 0
        total_page:
          type: integer
          title: Total Page
          default: 0
        page_num:
          type: integer
          title: Page Num
          default: 1
        page_size:
          type: integer
          title: Page Size
          default: 10
        items:
          items:
            $ref: '#/components/schemas/KnowledgeFileWithDocument'
          type: array
          title: Items
          default: []
      type: object
      title: KnowledgeFilePagination
    ErrorResponse:
      properties:
        code:
          type: integer
          title: Code
        message:
          type: string
          title: Message
      type: object
      required:
        - code
        - message
      title: ErrorResponse
    KnowledgeFileWithDocument:
      properties:
        file:
          anyOf:
            - $ref: '#/components/schemas/FileRead'
            - type: 'null'
        document:
          anyOf:
            - $ref: '#/components/schemas/DocumentWithProgress'
            - type: 'null'
      type: object
      title: KnowledgeFileWithDocument
    FileRead:
      properties:
        created_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated At
        knowledge_id:
          type: string
          maxLength: 20
          title: Knowledge Id
        type:
          type: string
          maxLength: 128
          title: Type
          description: folder, pdf, txt ...
          default: folder
        parent_id:
          type: string
          maxLength: 20
          title: Parent Id
          default: ''
        parent_ids:
          items:
            type: string
          type: array
          title: Parent Ids
          description: Parent folder ID list
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
          default: ''
        original_name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Original Name
          description: file original name
          default: ''
        location:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: Location
          default: ''
        path:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: Path
          default: ''
        source_location:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: Source Location
          default: ''
        size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size
          description: File byte size
          default: 0
        source_type:
          type: string
          maxLength: 128
          title: Source Type
          default: tencent, web
        complete_flag:
          type: integer
          title: Complete Flag
          description: 'Complete flag, 0: init, 1: complete'
          default: 0
        file_id:
          type: string
          title: File Id
        org_id:
          type: string
          title: Org Id
        user_id:
          type: string
          title: User Id
        status:
          type: integer
          title: Status
      type: object
      required:
        - created_at
        - updated_at
        - knowledge_id
        - parent_ids
        - file_id
        - org_id
        - user_id
        - status
      title: FileRead
    DocumentWithProgress:
      properties:
        created_at:
          type: integer
          title: Created At
        updated_at:
          type: integer
          title: Updated At
        org_id:
          type: string
          title: Org Id
        user_id:
          type: string
          title: User Id
        overall_summarize_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Overall Summarize Enabled
          description: Generate an overall summary. Boolean
          default: true
        smart_indexing_mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Smart Indexing Mode
          description: >-
            Smart indexing mode. 0: disabled (recommended), 1: standard, 2:
            advanced
          default: 0
        smart_indexing_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Smart Indexing Enabled
          description: >-
            Enable smart indexing. Boolean. Takes effect only together with
            smart_indexing_mode 2 (advanced); leaving it false is recommended
            unless the corpus needs it, as it adds noticeable processing time
            and token cost
          default: true
        split_media_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Split Media Enabled
          description: Generate media segments. Boolean
          default: true
        pdf_parsing_mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Pdf Parsing Mode
          description: 'PDF parsing mode. 1: page, 2: section (recommended), 3: section v2'
          default: 2
        pdf_parsing_element_types:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Pdf Parsing Element Types
          description: 'pdf parsing element list, eg: [1, 2]. 1: table, 2: image, 3: formula'
          default:
            - 1
            - 2
        read_pdf_pages:
          anyOf:
            - type: string
            - type: 'null'
          title: Read Pdf Pages
          description: 'read pdf pages, Example: ''1,3,4'' or ''1,4-end'' or ''all'''
        audio_parsing_mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Audio Parsing Mode
          description: 'audio parsing mode, 1: transcript, 2: speaker diarization'
        audio_chunk_mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Audio Chunk Mode
          default: 1
        dataset_id:
          type: string
          title: Dataset Id
        file_id:
          type: string
          title: File Id
        name:
          anyOf:
            - type: string
              maxLength: 256
            - type: 'null'
          title: Name
        document_type:
          anyOf:
            - type: integer
            - type: 'null'
          title: Document Type
          default: 1
        next_step:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Next Step
          description: next step
          default: true
        llm:
          anyOf:
            - type: object
            - type: 'null'
          title: Llm
          default: {}
        metadata_info:
          type: object
          title: Metadata Info
          default: {}
        task_priority:
          anyOf:
            - type: integer
            - type: 'null'
          title: Task Priority
          description: task priority
        description:
          anyOf:
            - type: string
              maxLength: 512
            - type: 'null'
          title: Description
          default: ''
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
          default: ''
        step_status:
          anyOf:
            - type: integer
            - type: 'null'
          title: Step Status
          default: 100
        status:
          anyOf:
            - type: integer
            - type: 'null'
          title: Status
          default: 1
        process_status:
          anyOf:
            - type: integer
            - type: 'null'
          title: Process Status
          default: 100
        version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Version
          default: 2
        splitter_type:
          anyOf:
            - type: integer
            - type: 'null'
          title: Splitter Type
          default: 1
        splitter:
          type: object
          title: Splitter
          default: {}
        sections:
          items:
            type: object
          type: array
          title: Sections
          default: []
        content_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Text
          description: ''
        trim_text:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Trim Text
          description: ''
          default: true
        document_id:
          type: string
          title: Document Id
        eta:
          anyOf:
            - type: integer
            - type: 'null'
          title: Eta
        eta_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Eta Text
        total_steps:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Steps
          default: 4
      type: object
      required:
        - org_id
        - user_id
        - dataset_id
        - file_id
        - document_id
      title: DocumentWithProgress
      description: Document with progress information for API responses
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````