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

# Ingest a Google Drive file or folder by sharing URL

> Given a Google Drive sharing URL, ingest the content into the knowledge base.

- **File URL** (``/file/d/``, ``/open?id=``, Docs/Sheets/Slides): downloads,
  extracts text, chunks, embeds and persists to Qdrant + Postgres.
- **Folder URL** (``/drive/folders/``): lists all non-folder files in the
  folder, ingests each supported file individually, and returns a summary.

All files must be shared (view access) with the service account email returned
by ``GET /v1/knowledge/gdrive/info``.



## OpenAPI

````yaml /api-reference/knowledge-api.json post /v1/knowledge/ingest/gdrive
openapi: 3.1.0
info:
  title: Strattum Knowledge API
  description: >-
    REST API that serves semantic document search — embeddings via the
    configured LLM provider, indexed in Qdrant, with metadata stored in
    PostgreSQL. (PRD-004, Workstream 1.4)
  version: 1.0.0
servers: []
security: []
paths:
  /v1/knowledge/ingest/gdrive:
    post:
      tags:
        - ingest
        - ingest
      summary: Ingest a Google Drive file or folder by sharing URL
      description: >-
        Given a Google Drive sharing URL, ingest the content into the knowledge
        base.


        - **File URL** (``/file/d/``, ``/open?id=``, Docs/Sheets/Slides):
        downloads,
          extracts text, chunks, embeds and persists to Qdrant + Postgres.
        - **Folder URL** (``/drive/folders/``): lists all non-folder files in
        the
          folder, ingests each supported file individually, and returns a summary.

        All files must be shared (view access) with the service account email
        returned

        by ``GET /v1/knowledge/gdrive/info``.
      operationId: ingest_gdrive_v1_knowledge_ingest_gdrive_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GDriveIngestRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/GDriveIngestResponse'
                  - $ref: '#/components/schemas/GDriveFolderIngestResponse'
                title: Response Ingest Gdrive V1 Knowledge Ingest Gdrive Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GDriveIngestRequest:
      properties:
        url:
          type: string
          title: Url
        teams:
          items:
            type: string
          type: array
          title: Teams
          default: []
        tags:
          items:
            type: string
          type: array
          title: Tags
          default: []
      type: object
      required:
        - url
      title: GDriveIngestRequest
      description: Body for POST /v1/knowledge/ingest/gdrive.
    GDriveIngestResponse:
      properties:
        doc_id:
          type: string
          title: Doc Id
        title:
          type: string
          title: Title
        chunks:
          type: integer
          title: Chunks
        source:
          type: string
          title: Source
        file_id:
          type: string
          title: File Id
      type: object
      required:
        - doc_id
        - title
        - chunks
        - source
        - file_id
      title: GDriveIngestResponse
      description: Response for POST /v1/knowledge/ingest/gdrive — single file.
    GDriveFolderIngestResponse:
      properties:
        folder_id:
          type: string
          title: Folder Id
        folder_name:
          type: string
          title: Folder Name
        source:
          type: string
          title: Source
        documents:
          items:
            $ref: '#/components/schemas/GDriveFileIngestResult'
          type: array
          title: Documents
        ingested:
          type: integer
          title: Ingested
        skipped:
          type: integer
          title: Skipped
        total_chunks:
          type: integer
          title: Total Chunks
      type: object
      required:
        - folder_id
        - folder_name
        - source
        - documents
        - ingested
        - skipped
        - total_chunks
      title: GDriveFolderIngestResponse
      description: Response for POST /v1/knowledge/ingest/gdrive — folder URL.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GDriveFileIngestResult:
      properties:
        doc_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Doc Id
        file_id:
          type: string
          title: File Id
        title:
          type: string
          title: Title
        chunks:
          type: integer
          title: Chunks
          default: 0
        skipped:
          type: boolean
          title: Skipped
          default: false
        skip_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Skip Reason
      type: object
      required:
        - file_id
        - title
      title: GDriveFileIngestResult
      description: Result for a single file ingested as part of a folder ingest.
    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

````