Skip to main content
Version: v3

Publish an app to its live site.

POST 

/ai-builder-api/projects/:projectId/infra/promote-to-production

Publishes the app to its live site: its managed address, and every custom domain attached to it (changes kind domain) once that domain is active. A domain that becomes active later joins the live site without another publish. Check GET .../publishability first and send the sourceRunId it returns, so the build the creator approved is the one that goes live. Returns a publish job: poll GET .../infra/publish-jobs/{publishJobId} until status is succeeded (publishedUrl is the live site) or failed (error says why). Send the same idempotencyKey to retry safely.

Request​

Version stringrequired

The API version.

Available optionsv3
projectId stringrequired

The project.

Possible values: Value must match regular expression ^prj_[A-Za-z0-9_-]+$

application/json

Bodyrequired

    sourceRunIdstring

    Exact successful run backing the preview approved by the creator. When provided, publish fails closed instead of selecting a different run that became ready concurrently.

    Possible values: Value must match regular expression ^run_[A-Za-z0-9_-]+$

    idempotencyKeystring

    Stable retry key. Domain-aware clients should always provide one; when omitted, source-bound requests receive a deterministic server-generated key while source-less legacy requests remain independent publish attempts.

    Possible values: non-empty and <= 200 characters

application/json

Publish job accepted.

Schema
    jobIdstringrequired

    The publish job; poll it with GET .../infra/publish-jobs/{publishJobId}.

    hostnamestring | nullnullablerequired

    The managed address the app is published to.

    aliasesstring[]required

    The active custom domains the publish also serves.

    domainRevisioninteger | nullnullablerequired

    The managed address's revision this publish took.

    Possible values: >= 0

    url(string | null)<uri>nullablerequired

    The live site's address once the job succeeds.

    statusstringrequired

    The job's state; queued when accepted.

    Available optionsqueuedrunningsucceededfailed