> ## 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.

# Start a new chat session and open documents into it in one call.

> Create a session AND open N saved documents into it in ONE call (the documents are SHARED,
never copied — the same cross-session behavior as /documents/open). The web UI passes its own
session_id so its session model stays consistent; an MCP/API integrator can omit it and the
server mints one — the one-call way to start a session with documents already open. With no
document_ids it just returns a fresh, empty session. The open semantics (first document focused,
durable binding, returned roster) are identical to /documents/open.



## OpenAPI

````yaml /openapi.json post /v1/sessions/init
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/init:
    post:
      tags:
        - v1
        - mcp
        - sessions
      summary: Start a new chat session and open documents into it in one call.
      description: >-
        Create a session AND open N saved documents into it in ONE call (the
        documents are SHARED,

        never copied — the same cross-session behavior as /documents/open). The
        web UI passes its own

        session_id so its session model stays consistent; an MCP/API integrator
        can omit it and the

        server mints one — the one-call way to start a session with documents
        already open. With no

        document_ids it just returns a fresh, empty session. The open semantics
        (first document focused,

        durable binding, returned roster) are identical to /documents/open.
      operationId: init_session
      parameters:
        - name: include_html
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Include each document's full reassembled HTML body. Default false
              (token-light — recommended for AI agents enumerating or switching
              tabs): returns only ids, title, section count, focused flag, and
              page setup, omitting the body which can be hundreds of KB per
              document. The web app passes true to render document content.
            default: false
            title: Include Html
          description: >-
            Include each document's full reassembled HTML body. Default false
            (token-light — recommended for AI agents enumerating or switching
            tabs): returns only ids, title, section count, focused flag, and
            page setup, omitting the body which can be hundreds of KB per
            document. The web app passes true to render document content.
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitSessionRequest'
      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:
    InitSessionRequest:
      properties:
        document_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Document Ids
          description: >-
            Durable document ids (from GET /v1/documents) to open into the
            brand-new session. Omit/empty to start an empty session.
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
          description: >-
            Optional client-chosen session id (the web UI passes its own so its
            session model stays consistent). Omit and the server mints one — the
            one-call way for an MCP/API integrator to start a session with
            documents already open.
      type: object
      title: InitSessionRequest
    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

````