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

# List files

> <p>List your files: uploads and run outputs. Default order is newest first.</p>



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/indices/openapi.documented.yml get /v1beta/files
openapi: 3.1.0
info:
  title: Indices API
  description: 'The Indices REST API. See docs for details: https://docs.indices.io'
  version: 0.0.1
servers:
  - url: https://api.indices.io
security:
  - ApiKeyAuth: []
tags:
  - name: Capture Sessions
    description: >-
      Record a browser session; a completed capture is a reusable input for
      building connectors.
  - name: Connectors
    description: Manage connectors.
  - name: Runs
    description: Execute a connector.
  - name: Secrets
    description: Manage secrets like login credentials and API keys.
paths:
  /v1beta/files:
    get:
      tags:
        - Files
      summary: List files
      description: >-
        <p>List your files: uploads and run outputs. Default order is newest
        first.</p>
      operationId: listFiles
      parameters:
        - name: run_id
          in: query
          required: false
          schema:
            description: Only files produced by this run.
            title: Run Id
            type: string
          description: Only files produced by this run.
        - name: connector_id
          in: query
          required: false
          schema:
            description: Only files produced by runs of this connector.
            title: Connector Id
            type: string
          description: Only files produced by runs of this connector.
        - name: filename
          in: query
          required: false
          schema:
            description: Only files whose name contains this text.
            title: Filename
            type: string
          description: Only files whose name contains this text.
        - name: source
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/FileSource'
            description: Only files from this source.
            title: Source
          description: Only files from this source.
        - name: sort
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/FileListSort'
            description: 'Column to sort by: name, created_at, size_bytes, or source.'
            default: created_at
          description: 'Column to sort by: name, created_at, size_bytes, or source.'
        - name: order
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/SortOrder'
            description: Sort direction.
            default: desc
          description: Sort direction.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Maximum number of files to return.
            default: 20
            title: Limit
          description: Maximum number of files to return.
        - name: cursor
          in: query
          required: false
          schema:
            description: >-
              Cursor from a previous response's `next_cursor`, to fetch the next
              page.
            title: Cursor
            type: string
          description: >-
            Cursor from a previous response's `next_cursor`, to fetch the next
            page.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFilesResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Indices from 'indicesio';

            const client = new Indices({
              apiKey: process.env['INDICES_API_KEY'], // This is the default and can be omitted
            });

            // Automatically fetches more pages as needed.
            for await (const file of client.beta.files.list()) {
              console.log(file.id);
            }
        - lang: Python
          source: |-
            import os
            from indices import Indices

            client = Indices(
                api_key=os.environ.get("INDICES_API_KEY"),  # This is the default and can be omitted
            )
            page = client.beta.files.list()
            page = page.data[0]
            print(page.id)
components:
  schemas:
    FileSource:
      type: string
      enum:
        - UPLOAD
        - RUN_OUTPUT
      title: FileSource
    FileListSort:
      type: string
      enum:
        - name
        - created_at
        - size_bytes
        - source
      title: FileListSort
    SortOrder:
      type: string
      enum:
        - asc
        - desc
      title: SortOrder
    ListFilesResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/File'
          type: array
          description: Files for the requested page.
        has_more:
          type: boolean
          description: Whether more files exist after this page.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Pass as the `cursor` query parameter to fetch the next page. Null
            when has_more is false.
      type: object
      required:
        - data
        - has_more
        - next_cursor
      title: ListFilesResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    File:
      properties:
        id:
          type: string
          description: Unique identifier for the object.
        source:
          $ref: '#/components/schemas/FileSource'
          description: >-
            How the file came to exist: uploaded by the user or produced by a
            run.
        run_id:
          anyOf:
            - type: string
            - type: 'null'
          description: ID of the run that produced this file. Null for uploaded files.
        name:
          type: string
          description: User-facing filename.
        size_bytes:
          type: integer
          description: Size of the file in bytes.
        content_type:
          type: string
          description: MIME type of the file.
        crc32c:
          type: string
          description: Base64-encoded CRC32C checksum of the file content.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the file was created.
      type: object
      required:
        - id
        - source
        - run_id
        - name
        - size_bytes
        - content_type
        - crc32c
        - created_at
      title: File
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Enter your API key as the bearer token. Set header: `Authorization` to
        `Bearer <api_key>`

````