Skip to main content

Finalize a Site

After uploading all files, call finalize to make the site live. The API verifies every file has been uploaded to storage before activating the version. Finalize also performs a security scan on browser-delivered files. If SimpleHost detects what looks like an exposed private key or secret in client-side code, finalize will block the publish instead of putting that site live publicly.

Path Parameters

string
required
The site slug (e.g., bright-canvas-a7k2).

Headers

Request Body

string
required
The version ID from the create/update response at upload.versionId.

Example

Response (200)

The site is now live at the siteUrl.

Secure Publish Blocking

If finalize detects exposed secret material in the uploaded site files, it returns SECRET_DETECTED and the site does not go live. This is intentional. Static browser files are public, so private keys should not be published inside them.

Example Blocked Response

If you are publishing through an agent, the expected flow is:
  1. Explain the issue in plain English
  2. Ask the user for permission to secure it
  3. If the user agrees:
    • store the secret in site variables
    • approve the required proxy host
    • update only the published copy
    • retry finalize
  4. If the user refuses, do not publish the site
The goal is to keep the user’s original local files untouched unless they explicitly ask for local code changes.

Errors

Finalize will fail if any file in the manifest hasn’t been uploaded yet. Make sure all uploads complete before calling finalize.