HTML

Create HTML page

Changed on

Stores 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).

post/api/html

Request

  • Base URL
    https://brewpage.app
  • Auth
    • none
    • or API key in header X-Owner-Token

Query parameters

ns, string

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.

tags, string

Comma-separated tags

ttl, string

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.

format, string

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.

verbatim, boolean

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.

domain, string

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.

linkName, string

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.

template, string

Slug of the official template this page was made from (the slug of a GET /api/templates item).

Headers

X-Password, string

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.

User-Agent, string
X-Owner-Token, unknown

Reuse existing owner token to group entities under one owner. If omitted, a new token is generated

X-Delivery-Mode, 'path' | 'subdomain'

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

HtmlUploadRequest required
content, string required

HTML or markdown content to publish

filename, string nullable

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

showTopBar, boolean nullable

Per-content toggle for the frontend top toolbar. null = use global default (app.ui.show-top-bar-default)

format, string nullable

Optional content format, same values as the 'format' query param. Takes precedence over the query param when both are present.

state, object nullable

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.

lambda, string

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

HtmlUploadResponse required
id, string required

Unique 10-character alphanumeric page ID

namespace, string required
link, string required

Primary URL returned for browser viewing and sharing

ownerLink, string required

API URL for programmatic access (update/delete)

format, string

Stored format after auto-detect: html, markdown or a code format; may differ from the requested one. Absent when unknown.

title, string

Stored title: <title>, else first heading or text; JSON: root title or name; code: filename or e.g. 'JS snippet'. Absent if none.

expiresAt, string date-time required
sizeBytes, integer required
tags, string[] required
ownerToken, string required

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

result, PublicationResult

Publication outcome: code, action and optional reason. Action merged means an existing publication was returned instead of a new one.

visibilityNotice, string

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.'

deliveryModeReason, string

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.

deliveryNotice, string

Human-readable explanation of deliveryModeReason, including how to change the delivery mode. Absent whenever deliveryModeReason is absent.

manageUrl, string

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.

listed, boolean required

true = listed in the gallery and sitemap now (public, no password, not hidden).

listable, boolean required

false = never listed in the gallery whatever the namespace (JSON and KV, JSON pages, HTML and JSON files); listing does not apply

visibilityUrl, string

Owner: POST {"listed":false|true} here to unlist or list. Link unchanged.

updated, boolean

Owner only: true if this upload replaced your stored page; else absent.

stateApplied, boolean

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).

customDomain, DomainItem

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.

managementLink, string nullable required
routingCohort, string required
deliveryMode, string nullable required
requestedDeliveryMode, string nullable required
effectiveDeliveryMode, string nullable required
deliveryModeMatched, boolean nullable required
access, 'public' | 'unlisted' | 'protected' required

public: html, site and file listed in gallery and sitemap. unlisted: private, not listed. protected: link + password.

modeLocked, boolean required
hostingVersion, integer nullable required
linkName, string nullable

Link name of this public page, site or file; null = its random link. Absent when link names are not available.

notices, PublishNotice[]

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 stateApplied to the response with the status