# update_doc

> Change a draft or ready Doc, as the editor saves it: the title and/or the whole content (as `markdown`, or the TipTap JSON `content` from get_doc format json), at the `revision` you last read (get_doc).

Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: destructive: it emails people or cancels a send, so clients ask you first.

Change a draft or ready Doc, as the editor saves it: the title and/or the whole content (as `markdown`, or the TipTap JSON `content` from get_doc format json), at the `revision` you last read (get_doc). If anyone saved since, nothing is saved: 409 revision_conflict with the current revision; read it again and redo the change. While someone else has the doc open in the editor it is 423 locked. Markdown replaces the whole content and gives boxes new ids (their fixed values and owners set in the app are lost): for a small change to a doc with set-up boxes, edit the JSON instead. Also, for the creator or an owner/admin: status (draft or ready; sending marks it sent), visibility (private, workspace_view, workspace_edit) and page_size (a4, letter); these need no revision. A sent Doc can't change (409 read_only): duplicate_doc it. Returns the new revision. Markdown here is AppliFlo's doc format: # / ## / ### headings, paragraphs, - and 1. lists, > quotes, --- dividers, **bold** and *italic*, plus tokens: {{client.full_name}} (a variable filled from the CRM at send), [[box role=client kind=text label="Passport number"]] (a box a person fills; kind text, date, number, email, phone, checkbox, dropdown with options="A|B", initials), [[signature role=client]] (a signature block) and [[pagebreak]]. role is a role's name (as get_doc lists them) or key. Masked values (•••123) can't be sent back: ask the person for the full number.

## Inputs

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `doc_id` | string | yes | A Doc's doc_id (from list_docs, or list_documents' kind 'doc' rows). Up to 80 characters |
| `revision` | integer | no | The revision get_doc returned. Needed with title, markdown or content. At least 0 |
| `title` | string | no | Up to 200 characters |
| `markdown` | string | no | The new content as Markdown (replaces it all). Up to 400000 characters |
| `content` | object | no | The new content as TipTap JSON (replaces it all) |
| `status` | string | no | One of: draft, ready |
| `visibility` | string | no | private (default), workspace_view or workspace_edit. One of: private, workspace_view, workspace_edit |
| `page_size` | string | no | One of: a4, letter |
