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

# Add Datasourcefile

> add a new file to a datasource



## OpenAPI

````yaml https://api.insighto.ai/api/v1/openapi.json put /api/v1/datasource/{datasource_id}/{datasourcefile_id}/file
openapi: 3.1.0
info:
  title: Ragify
  version: v1
servers: []
security: []
paths:
  /api/v1/datasource/{datasource_id}/{datasourcefile_id}/file:
    put:
      tags:
        - Data Source
      summary: Add Datasourcefile
      description: add a new file to a datasource
      operationId: >-
        add_datasourcefile_api_v1_datasource__datasource_id___datasourcefile_id__file_put
      parameters:
        - name: datasource_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Datasource Id
        - name: datasourcefile_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Datasourcefile Id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_add_datasourcefile_api_v1_datasource__datasource_id___datasourcefile_id__file_put
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IPostResponseBase_IDataSourceFileRead_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Your API Key: []
        - HTTPBearer: []
components:
  schemas:
    Body_add_datasourcefile_api_v1_datasource__datasource_id___datasourcefile_id__file_put:
      properties:
        datasourcefile_file:
          type: string
          format: binary
          title: Datasourcefile File
      type: object
      required:
        - datasourcefile_file
      title: >-
        Body_add_datasourcefile_api_v1_datasource__datasource_id___datasourcefile_id__file_put
    IPostResponseBase_IDataSourceFileRead_:
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          default: Data created successfully
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - {}
            - type: 'null'
          title: Meta
          default: {}
        data:
          anyOf:
            - $ref: '#/components/schemas/IDataSourceFileRead'
            - type: 'null'
      type: object
      title: IPostResponseBase[IDataSourceFileRead]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    IDataSourceFileRead:
      properties:
        ds_type:
          anyOf:
            - $ref: '#/components/schemas/IDSEnum'
            - type: 'null'
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        attributes:
          additionalProperties: true
          type: object
          title: Attributes
          default: {}
        org_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Org Id
        id:
          type: string
          format: uuid
          title: Id
      type: object
      required:
        - ds_type
        - id
      title: IDataSourceFileRead
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    IDSEnum:
      type: string
      enum:
        - pdf
        - doc
        - http
        - tool
        - text_blob
        - image
        - text_image
      title: IDSEnum
  securitySchemes:
    Your API Key:
      type: apiKey
      description: >-
        Your API key for authentication. You can generate it from the
        **Settings** page. Format: starts with `in-`.
      in: query
      name: api_key
    HTTPBearer:
      type: http
      scheme: bearer

````