Update a site
update_siteReplaces the files of a slug owned by the token, or, when merge is true, adds and overwrites only the paths sent. Inputs: slug, files, and optional spa, merge, expected_version, via, and token. Returns url, path_url, slug, and a new version. When expected_version does not match the live version, the result is version_conflict and nothing is written. Two racing updates return version_conflict even without expected_version.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spa | No | Serve index.html for unknown paths. | |
| via | No | Optional label stored with the publish. At most 80 characters. An IP address, a URL, or an email address is not stored. A non-empty value replaces the X-Via header. | |
| slug | Yes | Slug you own. Must match ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$. Not rewritten. Reserved slugs are rejected. | |
| files | Yes | Path map, or an array of {path, content} or {path, base64}. Paths are stored exactly as given (a single top-level directory is not removed). Text as a string, binary as {"base64":"..."}. Example: {"index.html":"<!doctype html><h1>Hi</h1>","img/logo.png":{"base64":"iVBOR..."}}. Any other array is rejected. | |
| merge | No | Keep every path you do not send, and add or overwrite only these exact paths. | |
| token | No | Bearer token returned by your first publish (deed_tok_...). Optional if the MCP client sends Authorization: Bearer. | |
| expected_version | No | Live version this update is based on, such as "v3". If the site has moved on, the call returns version_conflict with no write. Omit it and a concurrent update still returns version_conflict rather than dropping files. |