# Sites and launch

## Create a site

`POST /sites` · MCP: `create_site`

Use an account-level credential. Supply `name` and optionally `hostingMode` (`managed` or `external`, default `managed`), `onboardingDomain`, and a caller-generated ULID `id`. Use managed hosting unless your integration is configured for an externally owned repository.

The JSON response includes `id`, `siteKey`, `name`, `status`, and `hostingMode`. Use `id` in API requests; `siteKey` is a short public identifier. Creation dispatches setup asynchronously. `onboardingDomain` is a reference for onboarding, not verified domain ownership.

## Lifecycle

| Status | Meaning / next action |
| --- | --- |
| `provisioning` | Repository and hosting setup is in progress; poll the site |
| `building` | Initial build is underway; inspect the owner-blocked queue for a draft decision |
| `ready` | Initial draft approved; preview the launch charge |
| `active` | Site is live |
| `paused` | Service is paused; inspect site and billing status |
| `failed` | Setup failed; inspect details before retrying |
| `archived` | Site is archived |
| `migrated` | Ownership moved; use credentials for the destination account |

Read `GET /sites/{siteId}/status` or MCP `get_site_status` for lifecycle, live-probe, domain, build, and configuration-propagation status. Individual sources can be unavailable; inspect their availability fields instead of treating missing data as healthy.

## Review the initial build

Read `GET /sites/{siteId}/owner-blocked` or call `list_needs_you`. In `items`, a `kind: "build"` entry identifies the current draft awaiting a decision. Use that entry's `id` as `buildId`. The result also includes `inFlight`; `complete: true` means all constituent reads succeeded.

Inspect the draft in your review workflow before approving. The owner-blocked queue identifies work; it is not the draft itself. Page and screenshot inspection describes the currently published/captured site and is not proof of an unlaunched draft. The Site Star dashboard remains available for visual draft review.

| Decision | HTTP | MCP |
| --- | --- | --- |
| Approve draft | `POST /sites/{siteId}/builds/{buildId}/approve` | `approve_build` |
| Request revision | `POST /sites/{siteId}/builds/{buildId}/revision` | `request_build_revision` |

Approve with an empty JSON object:

```sh
curl --fail-with-body "$SITESTAR_API_URL/sites/$SITE_ID/builds/$BUILD_ID/approve" \
  -H "Authorization: Bearer $SITESTAR_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{}'
```

Request a revision with `{"note":"Please use the existing emergency phone number."}`. The note is limited to 2,000 characters. Both operations require a user identity on the credential; the server records identity from trusted context, not input. State guards reject invalid transitions. Approval returns `build`, `site`, and `alreadyApproved`; an already-approved replay does not approve a different build. Revision returns the public build record.

For MCP, provide `buildId` to identify the draft reviewed. The schema also allows omission to resolve the current build; prefer the explicit ID when presenting a particular draft to a customer. Omit `siteId` only when the key binds it.

Approval makes the site eligible to launch; it does not charge or activate it. Staff draft submission is not published to external clients.

## Launch a ready site

`POST /sites/{siteId}/golive` · MCP: `golive_site`

First request a preview:

```json
{"origin":"https://portal.example.com","confirm":false}
```

Read the result's `action` and billing details. After the customer accepts the charge, repeat with the JSON boolean `confirm: true`. If `action` is `checkout`, the customer must complete the returned checkout URL; inspect current site state and continue the launch flow afterward. `action: "preview"` is not activation, and approval alone is not launch.

HTTP also supports `subscriptionId` or `newSubscription` to select the payment destination; they are mutually exclusive. Use the preview's payment target to make that choice explicit. On `SUBSCRIPTION_CHOICE_REQUIRED` or `SUBSCRIPTION_FULL`, inspect the returned alternatives rather than blindly retrying. MCP exposes basic launch without payment-target selection; resolve that choice through the UI or your HTTP integration.

A promotion code must be supplied on both preview and confirmation. Follow site status to confirm `active` and site activity to verify delivery.

## Ongoing changes

Later content and design work goes through [tasks and change review](/guides/tasks). Initial build decisions and ongoing change decisions are separate operations; neither is an arbitrary status setter.
