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

# Restore a document another session archived, keeping your current edits (web app).

> Restore (un-archive) a document that was archived, re-linking it to this session and bringing
its content back. `document_id` is the session-local id (same as /save); the durable id is
recovered from the cached document. Idempotent: restoring an already-active (or never-archived)
document is a no-op. Non-billable.

Two shapes: WITHOUT a body (e.g. an AI agent restoring a document by id) the archived content is
restored as-is; WITH a body carrying the current editor HTML (the web app's "keep editing
(restores it)" choice after another session deleted the document) the document is restored AND the
supplied edits are saved on top, so it converges for everyone.



## OpenAPI

````yaml /openapi.json post /v1/sessions/{session_id}/documents/{document_id}/unarchive
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}/unarchive:
    post:
      tags:
        - v1
        - sessions
      summary: >-
        Restore a document another session archived, keeping your current edits
        (web app).
      description: >-
        Restore (un-archive) a document that was archived, re-linking it to this
        session and bringing

        its content back. `document_id` is the session-local id (same as /save);
        the durable id is

        recovered from the cached document. Idempotent: restoring an
        already-active (or never-archived)

        document is a no-op. Non-billable.


        Two shapes: WITHOUT a body (e.g. an AI agent restoring a document by id)
        the archived content is

        restored as-is; WITH a body carrying the current editor HTML (the web
        app's "keep editing

        (restores it)" choice after another session deleted the document) the
        document is restored AND the

        supplied edits are saved on top, so it converges for everyone.
      operationId: restore_document_keep_editing
      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:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/SaveDocumentRequest'
                - type: 'null'
              title: Body
      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

````