> ## Documentation Index
> Fetch the complete documentation index at: https://cognitio-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List files

> List files and directories in a specified path.



## OpenAPI

````yaml /openapi.json get /file
openapi: 3.1.1
info:
  title: cognitio
  description: cognitio api
  version: 1.0.0
servers: []
security: []
paths:
  /file:
    get:
      summary: List files
      description: List files and directories in a specified path.
      operationId: file.list
      parameters:
        - in: query
          name: directory
          schema:
            type: string
        - in: query
          name: workspace
          schema:
            type: string
        - in: query
          name: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Files and directories
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FileNode'
      x-codeSamples:
        - lang: js
          source: |-
            import { createCognitioClient } from "@cognitio/sdk

            const client = createCognitioClient()
            await client.file.list({
              ...
            })
components:
  schemas:
    FileNode:
      type: object
      properties:
        name:
          type: string
        path:
          type: string
        absolute:
          type: string
        type:
          type: string
          enum:
            - file
            - directory
        ignored:
          type: boolean
      required:
        - name
        - path
        - absolute
        - type
        - ignored

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.