Skip to content
Docs

Sites and deploy

Publish a site

What this is
  1. Prepare index.html and use relative links for the other files. Keep servers and build tools out of the upload; upload their static output.

  2. Publish it.

    “Publish these files as my bakery site.” Confirm the name and address before the first publish.
  3. Open the returned address and test the links and form saves.

Update files

What this is
  1. Read the current file list before replacing files.

  2. Send the change.

    “On my bakery site, change the opening time to 8 am. Keep the other pages.”
  3. Open the live address and check the changed page.

Preview and publish a version

What this is
  1. Save the update with publish=false. Read GET /v1/sites/{sitename}/versions and note its version number.
  2. Create a preview with POST /v1/sites/{sitename}/versions/2/preview-link. Open the returned link; it stops working after an hour.
  3. Publish it with PUT /v1/sites/{sitename}/active-version and {"version_number":2}. To roll back, read the version list and send the earlier number instead.

Rename or take a site offline

What this is
  1. Choose the site and check its current name with GET /v1/sites.
  2. Send PATCH /v1/sites/{sitename} with {"name":"new-name"} to rename it, or {"offline":true} to take it offline.
  3. To reopen it, send {"offline":false} to the current name.

Delete or restore a site

What this is
  1. Download a copy with GET /v1/sites/{sitename}/export.tar.gz if you need it.
  2. Confirm the site name, then send DELETE /v1/sites/{sitename}.
  3. To undo, list GET /v1/me/deleted-sites and send POST /v1/sites/{sitename}/restore before the returned deadline. A deleted site is restorable for 7 days.

Errors you may see

Code Means Do this
site_exists (409) Name already used Update that site or choose another name
not_found (404) Update files: no matching site Read the site list
site_not_found (404) Rename or roll back: no matching site Read the site list
HTTP 404 (no code) Delete: no matching site Read the site list
item_too_large (413) Upload exceeds a cap Check Limits and errors

Next