Publish to dochost
publishPublish HTML or Markdown as a hosted web page and return a shareable URL. Use when the user asks to share an HTML quiz, calculator, report or Markdown document as a link. HTML JavaScript runs in a sandbox. Free links expire after seven days; paid link lifetime and options follow account entitlements. For revisions of an existing page, use update_page to keep the same link. Results report expiry and any ignored options; relay ignoredOptions/ignoredNote instead of claiming all requested settings were applied. New links use the account primary host; get_account reports it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Complete HTML or Markdown source to publish, preserving scripts and styles. Pass the content itself, not a summary, file path, URL or surrounding Markdown code fence. Single-file HTML must inline assets or use publicly accessible asset URLs. | |
| format | No | Use html for HTML source and markdown for Markdown. Omit only when you want automatic format detection. | |
| public | No | Whether the page is discoverable on Explore (default true). False does not password-protect the link; readers with its URL can still access an unprotected page. | |
| password | No | Requested reader password, subject to plan entitlement. Omit unless requested; check ignoredOptions/ignoredNote before claiming password protection. | |
| customSlug | No | Requested custom URL slug, subject to plan entitlement and availability. Omit unless the user requests one. | |
| noBranding | No | Omit to use the plan default: paid plans hide branding, free plans keep it. Set false if the user wants to keep the dochost mark. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The shareable page URL, on the account's primary host (custom domain, subdomain, or dochost.co/d). Relay it verbatim. | |
| note | No | Free-tier only: expiry warning + upgrade link. Relay this to the user. | |
| slug | Yes | ||
| format | Yes | ||
| expiresAt | No | ISO timestamp, or null when the link is permanent. | |
| permanent | Yes | ||
| ignoredNote | No | Plain-language consequence of ignoredOptions. Relay it instead of reporting plain success. | |
| iterateHint | No | How to revise this page later. Follow it instead of publishing a second time. | |
| ignoredOptions | No | Paid options this account does not have, which were dropped. Present only when non-empty — the publish still succeeded, but NOT as asked. |