Create HTML page
Changed onStores HTML or markdown content and returns a shareable link. Reuse existing owner token to group entities under one owner. Also accepts raw text/* (HTML, Markdown, YAML, XML, CSV, code) and application/octet-stream bodies — see /llms-full.txt. Secrets allowed; likely ones are flagged in notices. To share a password or key: POST /api/secrets (client-side encrypted one-time link).
Request
- Base URLhttps://brewpage.app
- Auth
- none
- or API key in header X-Owner-Token
Query parameters
Send ns=public for anything meant to be found or shared (docs, guides, demos, portfolios, reports, landing pages): listed in the public gallery and sitemap, so Google, Bing and AI search index it and people discover it. Public pages are served on the brewpage.app domain itself, for the strongest search reach; code that needs its own origin (cookies, storage) gets its own subdomain automatically. Anyone can find and read a public page: never put secrets, tokens or personal data there. No ns (default): private. Unlisted and not indexed; anyone who has the link can still open it. Lowercase only.
Comma-separated tags
TTL in days: up to 30 days without an account, up to 90 with a free profile (send its X-Owner-Token); a default applies when ttl is omitted. Accepts whole days: 15, 15d, 15 days.
Content format. 'html' (default) — stored as sent, except a whole page pasted from a chat is repaired (see 'verbatim'); omitted, source code or JSON is saved as its code format (notice format-detected). 'markdown' / 'md' — rendered to styled HTML via github-markdown-css. Code/text languages stored and served raw with format-specific MIME (text/csv, application/json, text/plain) plus X-Content-Type-Options: nosniff; raw reads of xml answer text/plain, downloads keep text/xml: yaml, json, xml, csv, tsv, log, toml, ini, sql, sh, bat, env, javascript, typescript, tsx, jsx, css, properties, docker, txt. Decides over a filename extension; unknown values are ignored. A whole HTML document sent as 'markdown' is published as an HTML page.
Store the content exactly as sent. By default a whole HTML page pasted from a chat (wrapped in a code block, surrounded by chat text, or entity-escaped) is restored and a notice is returned; 'true' keeps the text as is.
Custom domain to connect to the new publication, e.g. www.example.com or example.com (query parameter or form/multipart field). Needs an X-Owner-Token added to a free BrewPage profile; works for HTML pages of format html and for sites, without a password. The publication is always created; on success the answer carries customDomain with the DNS records[] to create; then call POST /api/publications/{type}/{ns}/{id}/domain/check once and read GET /api/publications/{type}/{ns}/{id}/domain until status is active. Otherwise one notice says why it was not set: domain-needs-account, domain-limit-reached, domain-not-eligible, domain-invalid, domain-not-registered, domain-account-restricted, domain-profile-ambiguous or domain-unavailable. Updates ignore it (notice domain-ignored): use PUT /api/publications/{type}/{ns}/{id}/domain.
Optional. Readable name for the public link of the new page, site or file, e.g. my-recipes (query parameter or form/multipart field; 6-20 lowercase letters, digits and hyphens with at least one letter). Needs ns=public and an X-Owner-Token added to a free BrewPage profile. The publication is always created; on success the answer carries linkName and link is https://brewpage.app/public/{linkName} (or https://{linkName}.brewpage.app/ on its own address). Otherwise it keeps its random link and one notice says why the name was not set: link-name-needs-account, link-name-unavailable, link-name-invalid, link-name-public-only, link-name-paused or link-name-limited. Updates ignore it (notice link-name-ignored): use POST /api/{type}/public/{id}/link-name.
Slug of the official template this page was made from (the slug of a GET /api/templates item).
Headers
Access password. Empty means no password restriction. Protected pages are never listed in the gallery or sitemap. OLD links accept ?p=; NEW access uses X-Password or a reader access cookie after password entry.
Reuse existing owner token to group entities under one owner. If omitted, a new token is generated
Delivery mode: path or subdomain. Sites and non-public HTML pages are always subdomain. The answer states the mode in effect (effectiveDeliveryMode, deliveryNotice). Omit it for the default.
Request body
HTML or markdown content to publish
Optional original filename used as the tab title fallback and download basename; without 'format' a known extension decides the format. Trimmed; rejected if it contains path separators or control characters, length > 200, or bare name shorter than 4 chars
Per-content toggle for the frontend top toolbar. null = use global default (app.ui.show-top-bar-default)
Optional content format, same values as the 'format' query param. Takes precedence over the query param when both are present.
Page data: lets visitors save entries on this HTML page. An object declares its lists and limits (e.g. {"collections":{"answers":{}}}; {} turns it on with defaults). The page gets its own address https://<label>.brewpage.app. null or no state field changes no page data settings, also when this upload updates your existing page. JSON body only; invalid settings answer 400 and nothing is published.
Brew Lambda server code: the text of lambda.js, one ES module of at most 32 KB that runs on BrewPage, never in the browser. Stored only with X-Owner-Token = a token of your profile (else notice lambda-needs-profile); turns page data on with defaults. Notices: lambda-stored, lambda-needs-profile, lambda-needs-html, lambda-unavailable, lambda-off. Over the size 413 LAMBDA_TOO_LARGE, code that does not load 400 LAMBDA_INVALID, 503 LAMBDA_UNAVAILABLE: try again; nothing is published then. Omit for none.
Response
Page created
Unique 10-character alphanumeric page ID
Primary URL returned for browser viewing and sharing
API URL for programmatic access (update/delete)
Stored format after auto-detect: html, markdown or a code format; may differ from the requested one. Absent when unknown.
Stored title: <title>, else first heading or text; JSON: root title or name; code: filename or e.g. 'JS snippet'. Absent if none.
Owner token: keep it (cannot be recovered; show it to the user on request); send it as X-Owner-Token on later publishes and updates
Publication outcome: code, action and optional reason. Action merged means an existing publication was returned instead of a new one.
Link access in words, e.g. 'Public: listed in the gallery and sitemap; search engines can index it.' (public html, site and file add an unlist hint), 'Public: anyone with the link. Not listed.' (public json, kv, json pages, json and html files), 'Private: not listed. Only via your unique private link.' or 'Password: link + password.'
Why the delivery mode was chosen or flagged. 'policy:subdomain-required' -- HTML pages in a private namespace always get their own subdomain. 'policy:state-declared' -- the request turned on page data ('state'), so the HTML page got its own subdomain whatever mode was asked. 'auto:<codes>' -- the page was published in subdomain mode automatically because it uses browser features a BrewPage link does not provide. 'advisory:<codes>' -- the mode was kept, but those features may not work fully on a BrewPage link. Codes are comma-separated in a fixed order: storage, cookies, history, downloads, top-navigation, media-capture, pointer-lock, embeds, fullscreen. Absent when nothing applies.
Human-readable explanation of deliveryModeReason, including how to change the delivery mode. Absent whenever deliveryModeReason is absent.
Management link, full control of this one publication. Give it to the user with the link; it is private, never post it publicly. Present only when minted.
true = listed in the gallery and sitemap now (public, no password, not hidden).
false = never listed in the gallery whatever the namespace (JSON and KV, JSON pages, HTML and JSON files); listing does not apply
Owner: POST {"listed":false|true} here to unlist or list. Link unchanged.
Owner only: true if this upload replaced your stored page; else absent.
Page data: true if this create stored the state settings it sent; false if it stored none (see notices). Absent when no settings were sent or state was ignored (null, page data unavailable).
A custom domain of a profile and what to do next (nextStep): create the records[] in DNS, call the check route once, then read the domain until status is active.
public: html, site and file listed in gallery and sitemap. unlisted: private, not listed. protected: link + password.
Link name of this public page, site or file; null = its random link. Absent when link names are not available.
Advisories about the request or its result; omitted when none.
Changes
- info
added the new optional request property
lambda - info
added the non-success response with the status
- info
added the optional property
stateAppliedto the response with the status
- info