Republish site
republish_siteReplace an existing BrewPage site in place at the same URL by uploading a complete new file set: new files are added, missing ones removed, matching ones overwritten. Requires the owner token.
Instructions
Republish (full-replace) an existing multi-file BrewPage site in place at the SAME URL/ID. Requires owner token. The uploaded bundle becomes the complete new file set — files absent from it are removed, new files added, matching files overwritten. Single-page: entryContent. Multi-page: files (array of {path, content}). Optional entry overrides the default index.html. Republishing preserves existing expiry. Old publications (made before 5 October 2026) are read-only: 409 OLD_PUBLICATION_READ_ONLY with createUrl to publish anew. Default limits (current: GET /api/limits): request 25 MiB; site 200 files, 5 MiB per file, 20 MiB total; path 380 characters. System files (.DS_Store, __MACOSX/ and similar) are skipped and never count; files with an unsupported extension or too-long path are skipped and listed in notices. Entry: entry, else root index.html, else the shallowest HTML file. Errors: 400 = a site limit exceeded (the message names it), invalid path, no HTML file, or a PDF/Office file unreadable or password-protected; 413 = request over 25 MiB, too many files and form fields, or a file name/path too long; 422 = no servable file left; 503 = busy, retry after Retry-After seconds. BrewPage tokens and manage links must never be in public content. Page code must not hide or alter the BrewPage badge; a profile can turn the badge off for a page.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"namespace": "<namespace>",
"id": "<id>"
},
"name": "republish_site"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Site ID | |
| tags | No | Optional tags; replace the site's stored tags. Omit to keep them. | |
| entry | No | Entry file path, default index.html | |
| files | No | Multi-file site: array of `{path, content}`. Mutually exclusive with `entryContent`. | |
| state | No | Page data config, same shape as on create. Lists named here are added or updated, the others stay; a stored list keeps its `mode` and `write` when the call omits them. Omitted: the stored config stays; `null` turns page data off (saved entries are kept). | |
| ttlDays | No | Ignored: republishing keeps the existing expiry; a supplied value comes back as a ttl-ignored notice. | |
| namespace | Yes | Site namespace | |
| ownerToken | No | Owner token from create. Default: env BREWPAGE_OWNER_TOKEN (local server only). | |
| entryContent | No | HTML content for a single-page site (entry file). Mutually exclusive with `files`. |