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

# List files

> List the files in a file-upload source with their indexing status. Each file carries the `sha256` of its bytes, so a client can compare a local folder against the source and upload only what changed.




## OpenAPI

````yaml get /brain/sources/{source_id}/files
openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
servers:
  - url: https://api.gumloop.com/api/v1
security: []
paths:
  /brain/sources/{source_id}/files:
    get:
      tags:
        - Brain
      summary: List files
      description: >
        List the files in a file-upload source with their indexing status. Each
        file carries the `sha256` of its bytes, so a client can compare a local
        folder against the source and upload only what changed.
      operationId: listBrainFiles
      parameters:
        - $ref: '#/components/parameters/BrainSourceId'
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: cursor
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: One page of files.
          content:
            application/json:
              schema:
                type: object
                required:
                  - files
                properties:
                  files:
                    type: array
                    items:
                      $ref: '#/components/schemas/BrainFile'
                  next_cursor:
                    type: string
                    nullable: true
        '401':
          description: Unauthorized — missing or invalid Gumloop API credentials.
        '403':
          description: Forbidden — the caller cannot view this source.
        '404':
          description: Source not found.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            curl
            'https://api.gumloop.com/api/v1/brain/sources/PFqdAMir8PA2Xc6qcszSN9/files'
            \
              -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
        - lang: python
          label: Python
          source: |
            from gumloop import Gumloop

            client = Gumloop(access_token="YOUR_ACCESS_TOKEN")
            for f in client.brain.list_files("PFqdAMir8PA2Xc6qcszSN9").files:
                print(f.file_name, f.status, f.sha256)
components:
  parameters:
    BrainSourceId:
      name: source_id
      in: path
      required: true
      schema:
        type: string
      description: The source id.
  schemas:
    BrainFile:
      type: object
      required:
        - id
        - file_name
        - status
      properties:
        id:
          type: string
        file_name:
          type: string
        mime_type:
          type: string
        size_bytes:
          type: integer
        sha256:
          type: string
          nullable: true
          description: Hex digest of the uploaded bytes.
        status:
          type: string
          enum:
            - uploaded
            - indexing
            - indexed
            - failed
        error:
          type: string
          nullable: true
          description: Why indexing failed, when `status` is `failed`.
        document_id:
          type: string
          nullable: true
          description: >-
            Set once the file is searchable; matches `document_id` on search
            results.
        created_at:
          type: string
          format: date-time
          nullable: true
        indexed_at:
          type: string
          format: date-time
          nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal API key or an [OAuth 2.0](/api-reference/oauth) access token.
        Personal API keys also require the `x-auth-key` header with your user
        ID.

````