
# 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.

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

Requires the `deploy` scope.

## Usage

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

## Authorizations

| Header | Type | Required | Description |
|--------|------|----------|-------------|
| Authorization | string | Yes | Bearer token (`Authorization: Bearer sp_...`). Created in the dashboard under Account > Tokens. See [authentication](/api/authentication). |

## Errors

| Code | Meaning |
|------|---------|
| 402 | `pro_features_in_use`: the workspace is not on Pro but the site uses Pro features, so its preview cannot go live. See [deploy](/api/deployments/post-deployments#errors). |
| 409 | The 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](/api/deployments/get-deployments) shape, which is the deployment plus `triggeredByName` and `changesSnapshot`.

A promotion that answers 200 is live and is the site's [live deployment](/api/deployments/get-deployments-live) 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.