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

# Generate context docs folder structure in Google Drive

> Generate context documents and write them to Google Drive.

Creates the full folder structure (context-docs/, company/, workstreams/)
with CLAUDE.md files and synthesized documents. Requires a Google Drive
connection with write access.

This is a synchronous endpoint — it runs all prompts in parallel and
creates the Drive structure before returning. Expect 1-3 minutes.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/hyperspell.yaml post /context-documents/drive-export
openapi: 3.1.0
info:
  title: Hyperspell API
  summary: >-
    Hyperspell is the memory layer for AI apps and agents. Through the API, you
    can add memories, connect data sources to index them in real-time, and
    search memories with our natural language query engine.
  termsOfService: https://hyperspell.com/blog/tos
  contact:
    name: Hyperspell
    url: https://hyperspell.com/
    email: hello@hyperspell.com
  version: 0.32.1
servers:
  - url: https://api.hyperspell.com
    description: Production
security:
  - APIKey: []
    AsUser: []
paths:
  /context-documents/drive-export:
    post:
      tags:
        - Context Documents
      summary: Generate context docs folder structure in Google Drive
      description: >-
        Generate context documents and write them to Google Drive.


        Creates the full folder structure (context-docs/, company/,
        workstreams/)

        with CLAUDE.md files and synthesized documents. Requires a Google Drive

        connection with write access.


        This is a synchronous endpoint — it runs all prompts in parallel and

        creates the Drive structure before returning. Expect 1-3 minutes.
      operationId: drive_export_context_documents_drive_export_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DriveExportRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriveExportResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKey: []
        - AsUser: []
components:
  schemas:
    DriveExportRequest:
      properties:
        workstream_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Workstream Name
          description: >-
            Generate docs for this workstream only (skip auto-detection). Used
            for the demo.
      type: object
      title: DriveExportRequest
      description: Request body for POST /context-documents/drive-export.
    DriveExportResponse:
      properties:
        status:
          type: string
          title: Status
        folder_count:
          type: integer
          title: Folder Count
        doc_count:
          type: integer
          title: Doc Count
        workstreams:
          items:
            additionalProperties:
              type: string
            type: object
          type: array
          title: Workstreams
        resource_count:
          type: integer
          title: Resource Count
      type: object
      required:
        - status
        - folder_count
        - doc_count
        - workstreams
        - resource_count
      title: DriveExportResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    APIKey:
      type: http
      description: >-
        API Key or JWT User Token. If using an API Key, set the X-As-User header
        to act as a specific user. A JWT User Token is always scoped to a
        specific user.
      scheme: bearer
      bearerFormat: Bearer <token>
    AsUser:
      type: apiKey
      description: >-
        Optionally set this header to act as a specific user when using an API
        Key, equivalent to first exchanging the API Key for a User Token
      in: header
      name: X-As-User

````