---
title: "Restore a document another session archived, keeping your current edits (web app)."
method: POST
path: "/v1/sessions/{session_id}/documents/{document_id}/unarchive"
tags: ["v1", "sessions"]
---

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

`POST /v1/sessions/{session_id}/documents/{document_id}/unarchive`

## Request

- Base URL: `https://api.superdocs.app`
- URL: `https://api.superdocs.app/v1/sessions/{session_id}/documents/{document_id}/unarchive`
- Auth: HTTP bearer

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.

## Path parameters

- `session_id` string, required
- `document_id` string, required

## Headers

- `authorization` string, nullable

## Request body

- SaveDocumentRequest: Body for the human-edit autosave.
  - `html` string, required
  - `page_setup` object, nullable
  - `window_id` string, nullable
  - `base_html` string, nullable
  - `base_digest` string, nullable
  - `touched_chunk_ids` string[], nullable
  - `deleted_part_chunk_ids` string[], nullable
  - `accept_rebased_committed` boolean, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/superdocs/apis/universal-document-ai-api.md) · [All operations](https://skmtc.dev/superdocs/apis/universal-document-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/superdocs/apis/universal-document-ai-api/revisions/37d03122940b?raw)
