---
title: "Save Document Draft"
method: PATCH
path: "/api/folders/documents/{document_id}/draft"
tags: ["domains"]
---

# Save Document Draft

`PATCH /api/folders/documents/{document_id}/draft`

## Request

- Base URL: `https://app.thinqos.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.thinqos.com/api/folders/documents/{document_id}/draft`
- Auth: none declared

Autosave a draft (TOS-6957): a crash/power-loss safety net, NOT a save.

Unlike ``PUT .../content``, this never appends a version row, never
re-indexes, and never touches ``full_text``/``content_hash`` - it is one
cheap UPDATE of three columns. It exists so the editor can debounce-save
on every pause in typing without paying the real save's cost, while still
letting a reopened document offer to restore work that was never
explicitly saved. A real save (``save_document_content``, any entry
point) clears the draft, since it has just been captured as a version.

## Path parameters

- `document_id` string, uuid, required

## Headers

- `x-impersonate-identity-id` string, nullable

## Request body

- SaveDocumentDraftRequest
  - `draft_content` string, required
  - `based_on_hash` string, nullable

## Response `200`

Successful Response

- SaveDocumentDraftResponse
  - `draft_saved_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/thinqos/apis/thinqos-api.md) · [All operations](https://skmtc.dev/thinqos/apis/thinqos-api/llms.txt) · [OpenAPI document](https://skmtc.dev/thinqos/apis/thinqos-api/revisions/ce2c2ce318b1?raw)
