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

# Persist a user-edited document (non-AI autosave).

> Persist a HUMAN-edited document — the editor's debounced autosave + save-on-blur — WITHOUT
an AI turn. Re-indexes the html into the target document (preserving its durable identity so it
UPDATES the same Files entry), then saves it so pure typing is preserved AND other sessions with
the same document open stay in sync. The AI-edit flow is unaffected (autosave saves first; a
later AI result is merged with your saved edits). Non-billable, REST-only (a UI affordance, not an MCP tool).



## OpenAPI

````yaml /openapi.json post /v1/sessions/{session_id}/documents/{document_id}/save
openapi: 3.1.0
info:
  title: Universal Document AI API
  description: AI-powered document editing with multi-tenant organization support
  version: 2.0.0
servers: []
security: []
paths:
  /v1/sessions/{session_id}/documents/{document_id}/save:
    post:
      tags:
        - v1
        - sessions
      summary: Persist a user-edited document (non-AI autosave).
      description: >-
        Persist a HUMAN-edited document — the editor's debounced autosave +
        save-on-blur — WITHOUT

        an AI turn. Re-indexes the html into the target document (preserving its
        durable identity so it

        UPDATES the same Files entry), then saves it so pure typing is preserved
        AND other sessions with

        the same document open stay in sync. The AI-edit flow is unaffected
        (autosave saves first; a

        later AI result is merged with your saved edits). Non-billable,
        REST-only (a UI affordance, not an MCP tool).
      operationId: save_human_document
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            title: Document Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaveDocumentRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SaveDocumentRequest:
      properties:
        html:
          type: string
          title: Html
        page_setup:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Page Setup
        window_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Window Id
        base_html:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Html
      type: object
      required:
        - html
      title: SaveDocumentRequest
      description: Body for the human-edit autosave.
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````