Upload site
Changed onUpload a multi-file HTML site as a ZIP archive or as individual files with paths. Returns a link to the published site. 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. A site always gets its own subdomain. 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.
Entry HTML file path (.html or .htm). Default: index.html, else the shallowest HTML file; a missing or non-HTML entry falls back to it and is reported in notices
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.
Headers
Access password
Reuse existing owner token to group entities under one owner
Request body multipart/form-data
Response
Site uploaded
Unique 10-character alphanumeric site ID
Entry HTML file resolved from the upload (e.g. index.html)
Entry page title: <title>, else first heading or text; absent if none.
Primary URL returned for browser viewing and sharing
API URL for programmatic access (info, delete)
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.'
true = listed in the gallery and sitemap now (public, no password, not hidden).
Owner: POST {"listed":false|true} here to unlist or list. Link unchanged. Absent when result.extras.isOwner is false.
Management link, shown once: give it to the user with the link; private, never post it publicly. Absent: old publication, or result.extras.isOwner is false.
Owner only: true if this upload replaced your stored site; 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.
Why this mode is in effect:'policy:subdomain-required', 'policy:mode-locked', 'policy:classic-link', 'policy:version-stale', 'policy:republish-keeps-mode', 'policy:custom-domain-attached' or 'policy:state-declared'. Absent when nothing applies.
Human-readable explanation of deliveryModeReason. Absent whenever deliveryModeReason is absent.
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 optional property
stateAppliedto the response with the status
- info
- info
added the new optional
queryrequest parameterlinkName
7 more changes in this revision
- info