Sites

Replaces the multi-file site bundle (ZIP archive or individual files with paths). Requires the owner token returned at creation. Password is preserved as-is (not changed in this operation).

put/api/sites/{ns}/{id}

Request

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

Path parameters

ns, string required
id, string required

Query parameters

tags, string

Comma-separated tags; replace the stored tags (empty clears). Omit to keep them

ttl, string

Not part of the update contract: updates keep the original expiry.

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

Headers

User-Agent, string
X-Delivery-Mode, string

Ignored on update: republishing keeps the address mode (reported in deliveryNotice); sites always stay on their own subdomain

X-Owner-Token, unknown

Owner token returned at creation

X-Manage-Key, unknown

Management key of this site

Request body

object required
lambda, string nullable required

Code-only site update as a JSON body, the site's files stay: the text of lambda.js replaces the code (notice lambda-stored), null removes it (notice lambda-removed). Needs X-Owner-Token = a token of the profile that published the code (else notice lambda-needs-profile).

Response

Site updated

SiteUpdateResponse required
id, string required

Unique 10-character alphanumeric site ID

namespace, string required
link, string required

Primary URL returned for browser viewing and sharing

ownerLink, string required

API URL for programmatic access (info, update, delete)

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.

fileCount, integer required
totalSizeBytes, integer required
expiresAt, string date-time required
tags, string[] required
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).

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 subschema #3 to the request body anyOf list

    • info

      added the media type application/json to the request body