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

# Ingest a source (file upload, YouTube URL, or webpage URL).

> Upload a file or provide a URL to ingest content. When uploading a file, send the request as `multipart/form-data` with the file in the `file` field and source metadata in the `source` field as a JSON string.

**Supported file types:** PDF, DOCX, DOC, PPTX, PPT, XLSX, XLS, TXT, CSV, PNG, JPEG.

**Supported source types (in the `source` JSON):**
  - `file` – upload a document or image via the `file` field.
  - `youtube` – provide a YouTube video URL in the `source` JSON `url` field.
  - `webpage` – provide a webpage URL in the `source` JSON `url` field.




## OpenAPI

````yaml /openapi/v1.yaml post /v1/ingestSource
openapi: 3.1.0
info:
  title: ConchAI B2B API (v1)
  version: 1.0.0
  description: |
    OpenAPI contract for the latest business-facing endpoints under /v1.
servers:
  - url: https://api.getconch.ai
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Organization
  - name: Sources
  - name: Flashcards
  - name: Mindmaps
  - name: Quizzes
paths:
  /v1/ingestSource:
    post:
      tags:
        - Sources
      summary: Ingest a source (file upload, YouTube URL, or webpage URL).
      description: >
        Upload a file or provide a URL to ingest content. When uploading a file,
        send the request as `multipart/form-data` with the file in the `file`
        field and source metadata in the `source` field as a JSON string.


        **Supported file types:** PDF, DOCX, DOC, PPTX, PPT, XLSX, XLS, TXT,
        CSV, PNG, JPEG.


        **Supported source types (in the `source` JSON):**
          - `file` – upload a document or image via the `file` field.
          - `youtube` – provide a YouTube video URL in the `source` JSON `url` field.
          - `webpage` – provide a webpage URL in the `source` JSON `url` field.
      operationId: ingestSource
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: >
                    The file to ingest. Accepted formats: PDF, DOCX, DOC, PPTX,
                    PPT, XLSX, XLS, TXT, CSV, PNG, JPEG/JPG. Required when
                    sourceType is `file`.
                source:
                  type: string
                  description: >
                    JSON string with source metadata. Must include `sourceType`
                    (one of `file`, `youtube`, `webpage`). Include `url` when
                    sourceType is `youtube` or `webpage`. Optionally include
                    `metadata` (object).
                  example: '{"sourceType":"file"}'
              required:
                - source
      responses:
        '200':
          description: Source ingested successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceDetailResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
components:
  schemas:
    SourceDetailResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/SourceDetail'
      required:
        - data
    SourceDetail:
      type: object
      properties:
        id:
          type: string
        sourceType:
          $ref: '#/components/schemas/SourceType'
        metadata:
          type: object
          additionalProperties: true
        title:
          type: string
        status:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - sourceType
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    SourceType:
      type: string
      enum:
        - file
        - youtube
        - webpage
        - lectureAudio
        - lectureVideo
  responses:
    BadRequestResponse:
      description: Invalid request payload.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnauthorizedResponse:
      description: Missing or invalid authentication credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerErrorResponse:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Business API key issued per organization.

````