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.
POST /api/v1/publish/:slug/finalize

Path Parameters

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

Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
AuthorizationConditionalRequired for authenticated sites. Not needed for anonymous sites.

Request Body

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

Example

curl -X POST https://simplehost.dev/api/v1/publish/bright-canvas-a7k2/finalize \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sh_live_your_key_here" \
  -d '{"versionId": "01jm4abc123def456"}'

Response (200)

{
  "slug": "bright-canvas-a7k2",
  "siteUrl": "https://bright-canvas-a7k2.simplehost.dev/",
  "versionId": "01jm4abc123def456",
  "status": "active"
}
The site is now live at the siteUrl.

Errors

StatusCodeReason
404NOT_FOUNDSite not found
401UNAUTHORIZEDNot authorized to finalize this site
400INVALID_REQUESTversionId doesn’t match the pending version
400INVALID_REQUESTNot all files have been uploaded
Finalize will fail if any file in the manifest hasn’t been uploaded yet. Make sure all uploads complete before calling finalize.