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, token, listed, category, tags, title, and description. Returns url, path_url, slug, listing, 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. listed defaults to false. Password-protected sites cannot be listed. A new version of a listed slug runs the gallery checks again. If the files total more than about 3.5 MB, do not call update_site. Call plan_upload, run commands in a shell, then finalize_upload. Or run node publish-large.mjs <dir> (https://deed.page/cli/publish-large.mjs).
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. | |
| tags | No | Up to 5 tags. Each tag is lowercase letters, digits, and hyphens, at most 32 characters. | |
| 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. | |
| title | No | Gallery title, at most 80 characters. Required when listed is true. | |
| token | No | Bearer token returned by your first publish (deed_tok_...). Optional if the MCP client sends Authorization: Bearer. | |
| listed | No | Opt into the public gallery. Default false. false removes the slug immediately. Password-protected sites cannot be listed. | |
| category | No | Gallery category. Required when listed is true. | |
| description | No | Gallery description, at most 300 characters. Required when listed is true. | |
| idempotency_key | No | Optional retry key, 16-255 visible ASCII characters (a random UUID works). If this call fails with a connection reset, a timeout, or a 502 or 503, call it once more with the same arguments and the same idempotency_key: a publish that already went through is replayed (same slug, same version, same token, idempotent_replayed: true) instead of being written twice. The Idempotency-Key HTTP header works the same way. | |
| 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. |