Sites

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

post/api/sites

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

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.

entry, string

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

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.

Headers

X-Password, string

Access password

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

Reuse existing owner token to group entities under one owner

Request body multipart/form-data

union required
object required
OR
object required

Response

Site uploaded

SiteUploadResponse required
id, string required

Unique 10-character alphanumeric site ID

namespace, string required
entryFile, string required

Entry HTML file resolved from the upload (e.g. index.html)

title, string

Entry page title: <title>, else first heading or text; absent if none.

link, string required

Primary URL returned for browser viewing and sharing

ownerLink, string required

API URL for programmatic access (info, delete)

fileCount, integer required
totalSizeBytes, integer required
expiresAt, string date-time 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.'

listed, boolean required

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

visibilityUrl, string

Owner: POST {"listed":false|true} here to unlist or list. Link unchanged. Absent when result.extras.isOwner is false.

manageUrl, string

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.

updated, boolean

Owner only: true if this upload replaced your stored site; 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
deliveryModeReason, string

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.

deliveryNotice, string

Human-readable explanation of deliveryModeReason. Absent whenever deliveryModeReason is absent.

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

    • info

      added the new optional query request parameter linkName

    7 more changes in this revision