Promote a preview

Promote a ready preview to live: the site starts serving the preview in a single step, and the promotion is recorded in build history attributed to the token.

POST https://sitepaste.com/api/v1/public/sites/{siteId}/previews/{previewId}/promote

Requires the deploy scope.

Usage

curl -X POST "https://sitepaste.com/api/v1/public/sites/default/previews/pv7k3q9r2m4x/promote" \
  -H "Authorization: Bearer $TOKEN"

Authorizations

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token (Authorization: Bearer sp_...). Created in the dashboard under Account > Tokens. See authentication.

Errors

CodeMeaning
402pro_features_in_use: the workspace is not on Pro but the site uses Pro features, so its preview cannot go live. See deploy.
409The preview is not ready, or was expired or replaced while the promotion ran

Response

200 OK with the deployment record the promotion wrote, in the deploy history shape, which is the deployment plus triggeredByName and changesSnapshot.

A promotion that answers 200 is live and is the site’s live deployment from then on. One that fails leaves the preview ready and the site as it was, and can be sent again.

400 when {previewId} is malformed. 404 when it is well formed but names no preview on this site.