Update site
update_siteUse when the user wants to push the new version, ship the changes they just made, or update the page while keeping the same link. Replaces a site's content in place by id. Accepts the same inputs as publish_site (HTML, a bundle, or a single document such as Markdown, .ipynb, PDF, .docx, .pptx, .xlsx, CSV, an image, a video, an audio, a Mermaid diagram or a text file, which is re-rendered; pass filename for a lone non-zip file, and include_original as on publish_site); the detected content_kind may change, and the result warns when html has replaced a site that was rendered from a file. Preserves the URL, visibility, allowlist, link expiry, and view password, and records a new version. Open viewers are offered a Refresh to the new content (a landing page, framed in the marketing site, shows it on its next load). Like publish_site, the new content is scanned for window.SNAPHOST data usage and any new collections are set up to match how the page uses them (reported in the result), and for external references the site's security policy will block; relay those to the owner and either trust the approved origins (add_external_origins) or vendor the assets. Relative references to files missing from the upload are reported too; include those files and republish.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | A single self-contained HTML document | |
| site_id | Yes | The id of the site to update | |
| filename | No | The uploaded file's own name with its extension (`report.pdf`, `photo.png`, `data.csv`). Give it once, at create_bundle_upload; a name given here as well must match it. Pass it here only for a single non-zip file whose upload was opened without one, so it is rendered as its kind; an upload that no name describes and that is neither a zip nor an HTML page is refused. For a .docx, .pptx or .xlsx sent as `zipBase64`, give its name here: it heads the bar and names the download. Ignored for a .zip bundle. A name SnapHost does not take is refused with the export that would work. | |
| printable | No | The page is built to print (a PDF that keeps the look): the design check asks for print styles, and a plain page gets the viewer's Print action (a report or a deck carries its own Download PDF button instead). Kept on later updates unless given again. | |
| upload_id | No | Reference a bundle already uploaded via create_bundle_upload (sent with upload_bundle_part, or PUT to its `upload_url`); use this for a large or multi-file app (e.g. a built React site) that exceeds the inline `html`/`zipBase64` limit, or for a single file that is not a zip (Markdown, a notebook, a PDF, an image, a video, an audio, a CSV, a Mermaid diagram or a text file), sent as it is together with `filename`. Mutually exclusive with `html` and `zipBase64`. | |
| zipBase64 | No | Base64-encoded .zip bundle (entry HTML + assets), for a multi-file bundle small enough to inline; a .docx, .pptx or .xlsx (zips themselves) or a one-entry zip holding a single Markdown, notebook, PDF, CSV, image, video, audio, Mermaid or text file under its real name also goes here. A single HTML document belongs in `html` instead: base64 has to be reproduced byte for byte and a long string often is not, so this input is rejected outright if the encoding or the archive checksums do not verify. | |
| workspace_id | No | Optional: the workspace to act in, from list_workspaces (the connection reaches the person's personal space and every workspace they are a member of). Required on a write when the connection reaches more than one workspace. Omit to act in the personal space (for an older single-workspace connection, the one workspace it was authorized for). | |
| document_kind | No | What the site is: a report, a presentation, a dashboard, or a plain page (the default). A publish or content update of such a site runs the design check (`design_warnings`); a presentation may go full screen. Kept on later updates unless given again. | |
| include_original | No | Whether readers may download the uploaded file itself from the page. Applies to a Word, PowerPoint or Excel file only, and is off by default for them, because the file holds what the page does not show: speaker notes, hidden slides, sheets, rows and columns, formulas, comments and tracked changes. Pass true to offer it anyway; on update_site, leave it out to keep the live version's choice. A macro-enabled .docm, .pptm or .xlsm is never offered. A CSV, image, video, audio, PDF, diagram or text file is its page and always downloads; a Markdown file or notebook becomes its page and has no download. The result reports `original_included`, and `render_notices` says what the page could not show (cells shown as formulas when a workbook carries no computed values; a file left out for size). Relay a notice to the user. |