pagehive

publish_site

Publish the draft atomically.

Publish and versionsChanges dataAll plans

What it does

Publish the draft atomically. Visitors see every file in that version together. A new site stays offline until this call, which sets it live and queues the first review. visibility may be private or public; omit it and the site stays as it is, so a new site stays private. The response includes visibility. published_at is the first publish time and does not change later. last_published_at updates on every publish. A publish with no file changes still stores a new version and updates last_published_at. A locked private site cannot be made public: that call is 403 validation_failed reason visibility_locked, details.published is false, and files on that call are not written. A private site's first publish returns a one-time link in view_link (review_link when review is on) and next_steps. Optional files are included in the same version. kind may be page, partial, css, script, robots, sitemap, or redirects. Optional delete removes items by kind and path or name, as in write_files, including uploaded files (kind asset). Files merge onto the draft unless replace is true. files and delete have no count limit (write_files takes 20), so a whole site goes live as one version in one call.

Plans

Works on every plan: Free, Basic, Pro and Ultra.

Parameters

NameTypeAbout
site_idrequiredstringThe id of the site. list_sites gives the ids of your sites.
messagestringA short note for the version history, like a commit message.
verbosebooleanDefault true: list every file and page of the version. false lists only what this call changed, plus draft totals.
replacebooleantrue makes files the whole draft, so anything not listed is removed. By default files merge onto the draft.
visibilityone of: private, publicSet private or public while publishing. Leave it out to keep the site as it is. Ask the owner before making a site public.
filesarray of objectsFiles to include in the same version, in the same shape as write_files. No count limit (write_files takes 20), so a whole site goes live in one call.
deletearray of objectsFiles to remove in the same version, each by kind and path or name.
idempotency_keystringAny unique string (1-200 printable ASCII). A retry with the same key and arguments returns the first call's result instead of running again. Same as the Idempotency-Key header.

Example

Call publish_site with these arguments:

{
  "site_id": "01a1…",
  "message": "New about page"
}

Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.

Related guides