Publish site
publish_sitePublish an HTML site to BrewPage. Single-page: entryContent. Multi-page: files (array of {path, content}). Optional entry overrides default index.html. Returns its primary share link and owner token. Default limits (current values: GET /api/limits): a request is at most 25 MB; a site at most 200 files, 5 MB per file and 20 MB in total; each path at most 380 characters. System files (.DS_Store, __MACOSX/ and similar) are skipped and never count; files with an unsupported extension or a 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 or no HTML file; 413 = request over 25 MB, too many files and form fields, or a file name/path too long; 422 = no servable file left. Returns manageUrl, a private management link (grants control; not for public sharing). Secrets allowed; likely ones are flagged in notices. Private namespace + password suit secrets.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entry | No | Entry file path, default index.html | |
| files | No | Multi-file site: array of `{path, content}`. Mutually exclusive with `entryContent`. | |
| ttlDays | No | Requested TTL: days as a number, or a string such as '2w', '36h' or '1 month' (default 15 days). The server rounds to whole days and clamps to the allowed range (1-30 by default; owner caps differ), reporting each adjustment in notices; the returned expiresAt is the actual expiry. | |
| password | No | Optional password to protect the site | |
| namespace | No | namespace=public: listed in the public gallery and the sitemap, so Google, Bing and AI search can find and index it and people can discover it. Suits anything meant to be found or shared: docs, guides, demos, portfolios, reports, landing pages. A site always gets its own subdomain. Anyone can find and read a public page, so it is unsuitable for secrets, tokens or personal data. Omit (default): private. Unlisted and not indexed; anyone who has the link can still open it. Lowercase only: 1-32 of a-z, 0-9, hyphen. | |
| ownerToken | No | Optional. Default: BREWPAGE_OWNER_TOKEN, else a new token per create. | |
| deliveryMode | No | Optional delivery choice for a fresh publication, independent of password/namespace. Fresh sites and HTML-format pages outside public (including the default unlisted namespace) always use subdomain; an explicit path there still publishes, on subdomain, with a delivery notice. Everything else in any namespace (Markdown, code/text, files, JSON, KV, public HTML) defaults to path (Promotion); public HTML may automatically choose subdomain for browser features. When creation returns an existing publication, it keeps its actual mode and URL. | |
| entryContent | No | HTML content for a single-page site (entry file). Mutually exclusive with `files`. |