# create_doc

> Start a new Doc (a contract or letter written in AppliFlo), private to the caller, as a draft.

Tool of the AppliFlo MCP server at `https://appliflo.com/api/mcp`. Kind: asks first: it changes something in your workspace, so clients ask you first.

Start a new Doc (a contract or letter written in AppliFlo), private to the caller, as a draft. Start it blank, from `markdown` or the editor's TipTap JSON `content`, from one of AppliFlo's contract templates (contract_template_id) or from a doc template the workspace saved (doc_template_id, as the app's Use). `roles` names the people it is for ({label, kind: signer|cc}, in signing order; default Client and Agent, both signing); Markdown tokens name them. Returns the doc with doc_id and revision 0, and markdown_issues listing any token that couldn't be read (left in the text as typed). Docs are a person's tool: an API key can't create one. An AppliFlo library contract no lawyer has reviewed is refused (409 contract_risk_required) until the person accepts the own-risk terms: ask them, then call again with risk_accepted: true. (Here: a contract template.) 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 |
| --- | --- | --- | --- |
| `title` | string | no | Defaults to "Untitled doc" (or the template's title). Up to 200 characters |
| `markdown` | string | no | The content as Markdown with AppliFlo's tokens. Up to 400000 characters |
| `content` | object | no | The content as TipTap JSON ({type: "doc", content: [...]}), as get_doc format json returns it |
| `contract_template_id` | string | no | One of AppliFlo's contract templates (list_templates kind contract), converted into a Doc. Up to 80 characters |
| `doc_template_id` | string | no | A doc template saved with save_doc_as_template: its current version. Up to 80 characters |
| `roles` | object[] | no | The people it is for, in signing order; kind signer (signs) or cc (gets a copy). 1 to 10 items |
| `roles[].label` | string | yes | Up to 60 characters |
| `roles[].kind` | string | yes | One of: signer, cc |
| `risk_accepted` | boolean | no | The person accepts AppliFlo's own-risk terms (Terms section 8A) for a library contract no lawyer has reviewed. Set it only after asking the person |
