> ## Documentation Index
> Fetch the complete documentation index at: https://00doc-web.vercel.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# publish_document

> Publish a new document or update an existing one.

# publish\_document

Publish a new document or update an existing one.

## Parameters

| Parameter     | Type   | Required | Description                                         |
| ------------- | ------ | -------- | --------------------------------------------------- |
| `title`       | string | Yes      | Document title                                      |
| `html`        | string | Yes      | Full HTML content of the document                   |
| `document_id` | uuid   | No       | Existing document ID to update. Omit to create new. |
| `note`        | string | No       | Version note / changelog entry                      |

## Returns

The tool returns JSON text from the API:

| Field         | Type   | Description                                                             |
| ------------- | ------ | ----------------------------------------------------------------------- |
| `document_id` | uuid   | Unique identifier for the document                                      |
| `version_id`  | uuid   | Identifier for this specific version                                    |
| `share_url`   | string | Live customer link (`https://unfurl.pub/d/…`) — share this with clients |

## Examples

### Create a new document

```
Tool call: publish_document
  title: "Q3 Sales Proposal — Acme Corp"
  html: "<!DOCTYPE html><html>...</html>"
  note: "Initial draft"
```

### Update an existing document

```
Tool call: publish_document
  title: "Q3 Sales Proposal — Acme Corp"
  html: "<!DOCTYPE html><html>...</html>"
  document_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  note: "Updated pricing section per client feedback"
```

<Warning>
  The `html` parameter must be a **complete HTML document** — include `<!DOCTYPE html>`, `<head>`, and `<body>` as appropriate for your content.
</Warning>

## Important notes

* **Omit `document_id` to create a new document.** Include it to update an existing one.
* **Save the `document_id` returned on creation** — you need it for future updates via MCP or when you instruct the model explicitly.
* **`share_url` is the link to send** — it stays the same when you publish again with the same `document_id`.
* **Version notes are optional but recommended** — they appear in your version history in the dashboard.

<Card title="Updating a document" icon="arrows-rotate" href="/guides/updating-a-document" />
