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

# List the files in a datasource's source

> Lists the files in the source behind the datasource (for example S3 or SharePoint), not the vector database, and flags which are already ingested. Use it to select files for ingestion. `selection_enabled` is false when the source holds too many files to select individually.



## OpenAPI

````yaml /deasy-openapi.yml get /v2/datasources/{datasource_id}/source-files
openapi: 3.1.0
info:
  title: Collibra Unstructured API
  description: >
    REST API for Collibra Unstructured.


    ## Authentication


    Every endpoint accepts either HTTP Basic credentials, or a bearer token sent
    together with the

    `X-User-ID` header identifying the user the call runs as.


    ## Base URL


    Your Unstructured deployment, for example
    `https://unstructured.your-company.com/rest/unstructured`.
  version: 0.1.14
servers:
  - url: /rest/unstructured
security:
  - BasicAuth: []
  - BearerAuth: []
    UserIdAuth: []
tags:
  - name: Core
    description: Endpoints for core functionality
  - name: Data
    description: Endpoints for source data
  - name: Metadata
    description: Endpoints for metadata management
  - name: Tags
    description: Endpoints for tag management
  - name: Taxonomy
    description: Endpoints for taxonomy management
  - name: Dataslice
    description: Endpoints for dataslice management
  - name: Progress Tracker
    description: Endpoints for tracking progress
  - name: Classification
    description: Endpoints for classification
  - name: Ingestion
    description: Endpoints for document ingestion
  - name: Workflows
    description: Endpoints for workflow management
  - name: Deduplication
    description: Endpoints for deduplication
paths:
  /v2/datasources/{datasource_id}/source-files:
    get:
      tags:
        - Data Connectors
      summary: List the files in a datasource's source
      description: >-
        Lists the files in the source behind the datasource (for example S3 or
        SharePoint), not the vector database, and flags which are already
        ingested. Use it to select files for ingestion. `selection_enabled` is
        false when the source holds too many files to select individually.
      operationId: listDatasourceSourceFiles
      parameters:
        - name: datasource_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Datasource Id
        - name: prefix
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Path prefix filter.
            title: Prefix
          description: Path prefix filter.
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Case-insensitive filename search.
            title: Search
          description: Case-insensitive filename search.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 10000
            minimum: 1
            default: 1000
            title: Limit
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceFilePage'
        '400':
          description: >-
            Invalid request, unsupported connector type, or the datasource's
            configuration or credentials are unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '401':
          description: Invalid or expired source credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '403':
          description: Access to the source was denied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '404':
          description: No accessible datasource with that id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while processing
            the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '501':
          description: Selective file ingestion is not enabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '502':
          description: Failed to list files from the source.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
      x-codeSamples:
        - lang: Python
          source: |
            # pip install deasy-sdk
            import os
            from deasy import DeasyClient

            client = DeasyClient(
                base_url=os.environ["UNSTRUCTURED_CLIENT_BASE_URL"],
                username=os.environ["UNSTRUCTURED_USERNAME"],
                password=os.environ["UNSTRUCTURED_PASSWORD"],
            )

            response = client.data_source.list_source_files(
                "example_datasource_id",
            )
            print(response.results)
components:
  schemas:
    SourceFilePage:
      properties:
        results:
          items:
            $ref: '#/components/schemas/SourceFileEntry'
          type: array
          title: Results
          description: The requested slice of the collection.
        limit:
          type: integer
          title: Limit
          description: Items requested per page.
        offset:
          type: integer
          title: Offset
          description: Items skipped before this page.
        total:
          type: integer
          title: Total
          description: Total number of files in the source.
        ingested_count:
          type: integer
          title: Ingested Count
          description: Ingested files among the entries in results (this page only).
        not_ingested_count:
          type: integer
          title: Not Ingested Count
          description: >-
            Not-yet-ingested files among the entries in results (this page
            only).
        selection_enabled:
          type: boolean
          title: Selection Enabled
          description: Whether the source supports selecting files to ingest.
      type: object
      required:
        - results
        - limit
        - offset
        - total
        - ingested_count
        - not_ingested_count
        - selection_enabled
      title: SourceFilePage
    StandardErrorResponse:
      properties:
        statusCode:
          type: integer
          title: Statuscode
          description: HTTP status code, repeated in the body.
        errorCode:
          type: string
          title: Errorcode
          description: Stable, specific, camelCase identifier for this condition.
          examples:
            - tagNotFound
        titleMessage:
          anyOf:
            - type: string
            - type: 'null'
          title: Titlemessage
          description: Short human-readable summary of the error class.
        userMessage:
          anyOf:
            - type: string
            - type: 'null'
          title: Usermessage
          description: Message safe to show to an end user.
        errorContext:
          anyOf:
            - type: string
            - type: 'null'
          title: Errorcontext
          description: W3C traceparent for the request that produced this error.
          examples:
            - 00-0af7651916cd43dd8448eb211c80319c-00f067aa0ba902b7-01
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Machine-readable payload specific to this errorCode. Present only
            for conditions a client can act on programmatically; the set of keys
            is documented per errorCode and only ever widens.
      type: object
      required:
        - statusCode
        - errorCode
      title: StandardErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HTTPError:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: HTTPError
    SourceFileEntry:
      properties:
        path:
          type: string
          title: Path
          description: Path of the file in the source.
        size:
          type: integer
          title: Size
          description: Size in bytes.
        last_modified:
          type: string
          format: date-time
          title: Last Modified
          description: Last modification time.
        is_ingested:
          type: boolean
          title: Is Ingested
          description: Whether the file has been ingested.
      type: object
      required:
        - path
        - size
        - last_modified
        - is_ingested
      title: SourceFileEntry
    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:
    BasicAuth:
      type: http
      scheme: basic
    BearerAuth:
      type: http
      scheme: bearer
    UserIdAuth:
      type: apiKey
      in: header
      name: X-User-ID

````

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