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

# List Files in Source

> List available files and folders in a specific content source. Supports pagination and folder navigation.



## OpenAPI

````yaml get /knowledge/{knowledge_id}/sources/{source_id}/files
openapi: 3.1.0
info:
  title: Agno API Reference
  description: The all-in-one, private, secure agent platform that runs in your cloud.
  version: 2.5.6
servers: []
security: []
paths:
  /knowledge/{knowledge_id}/sources/{source_id}/files:
    get:
      tags:
        - Knowledge
      summary: List Files in Source
      description: >-
        List available files and folders in a specific content source. Supports
        pagination and folder navigation.
      operationId: list_source_files
      parameters:
        - name: knowledge_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the knowledge base
            title: Knowledge Id
          description: ID of the knowledge base
        - name: source_id
          in: path
          required: true
          schema:
            type: string
            title: Source Id
            description: ID of the content source
          description: ID of the content source
        - name: prefix
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Path prefix to filter files
            title: Prefix
          description: Path prefix to filter files
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Number of files per page
            default: 100
            title: Limit
          description: Number of files per page
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            title: Page
            description: Page number (1-indexed)
            default: 1
          description: Page number (1-indexed)
        - name: delimiter
          in: query
          required: false
          schema:
            type: string
            description: Folder delimiter (enables folder grouping)
            default: /
            title: Delimiter
          description: Folder delimiter (enables folder grouping)
        - name: db_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The ID of the database to use
            title: Db Id
          description: The ID of the database to use
      responses:
        '200':
          description: Files listed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceFilesResponseSchema'
              example:
                source_id: company-s3
                source_name: Company Documents
                prefix: reports/
                folders:
                  - prefix: reports/2024/
                    name: '2024'
                    is_empty: false
                files:
                  - key: reports/annual-summary.pdf
                    name: annual-summary.pdf
                    size: 102400
                    last_modified: '2024-01-15T10:30:00Z'
                    content_type: application/pdf
                meta:
                  page: 1
                  limit: 100
                  total_pages: 1
                  total_count: 1
        '400':
          description: Unsupported source type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedResponse'
        '404':
          description: Knowledge base or content source not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    SourceFilesResponseSchema:
      properties:
        source_id:
          type: string
          title: Source Id
          description: ID of the content source
        source_name:
          type: string
          title: Source Name
          description: Name of the content source
        prefix:
          anyOf:
            - type: string
            - type: 'null'
          title: Prefix
          description: Prefix filter that was applied
        folders:
          items:
            $ref: '#/components/schemas/SourceFolderSchema'
          type: array
          title: Folders
          description: Subfolders at this level
        files:
          items:
            $ref: '#/components/schemas/SourceFileSchema'
          type: array
          title: Files
          description: List of files at this level
        meta:
          $ref: '#/components/schemas/PaginationInfo'
          description: Pagination metadata
      type: object
      required:
        - source_id
        - source_name
        - meta
      title: SourceFilesResponseSchema
      description: Response schema for listing files in a content source.
    BadRequestResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: BadRequestResponse
      example:
        detail: Bad request
        error_code: BAD_REQUEST
    UnauthenticatedResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: UnauthenticatedResponse
      example:
        detail: Unauthenticated access
        error_code: UNAUTHENTICATED
    NotFoundResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: NotFoundResponse
      example:
        detail: Not found
        error_code: NOT_FOUND
    ValidationErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: ValidationErrorResponse
      example:
        detail: Validation error
        error_code: VALIDATION_ERROR
    InternalServerErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: InternalServerErrorResponse
      example:
        detail: Internal server error
        error_code: INTERNAL_SERVER_ERROR
    SourceFolderSchema:
      properties:
        prefix:
          type: string
          title: Prefix
          description: Full prefix to use for navigating into this folder
        name:
          type: string
          title: Name
          description: Display name of the folder
        is_empty:
          type: boolean
          title: Is Empty
          description: Whether the folder contains any files
          default: false
      type: object
      required:
        - prefix
        - name
      title: SourceFolderSchema
      description: Schema for a folder in a content source.
    SourceFileSchema:
      properties:
        key:
          type: string
          title: Key
          description: Full path/key of the file
        name:
          type: string
          title: Name
          description: Display name (filename)
        size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size
          description: File size in bytes
        last_modified:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Modified
          description: ISO 8601 timestamp of last modification
        content_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Type
          description: MIME type of the file
      type: object
      required:
        - key
        - name
      title: SourceFileSchema
      description: Schema for a file in a content source.
    PaginationInfo:
      properties:
        page:
          type: integer
          minimum: 0
          title: Page
          description: Current page number (0-indexed)
          default: 0
        limit:
          type: integer
          minimum: 1
          title: Limit
          description: Number of items per page
          default: 20
        total_pages:
          type: integer
          minimum: 0
          title: Total Pages
          description: Total number of pages
          default: 0
        total_count:
          type: integer
          minimum: 0
          title: Total Count
          description: Total count of items
          default: 0
        search_time_ms:
          type: number
          minimum: 0
          title: Search Time Ms
          description: Search execution time in milliseconds
          default: 0
      type: object
      title: PaginationInfo
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````