latestOpenAPI 3.1.02026-08-193894215.9 MB

23dfbe1a0d1f

Apps

Deploy App

Builds the app's current source and ships it. Returns the run it started, so the caller can render progress from this response and then follow it on the app's deployment field. Only one deployment runs per app at a time — calling this while one is in flight reports that run rather than starting a second, and calling it with nothing to publish reports that instead of starting one.

post/apps/{id}/deploy

Headers

Idempotency-Keystring
Example:d9105228-4a08-46b1-8b91-42fed586d383

A unique key that makes this request safe to retry. See Idempotent requests.

Request body

draftboolean

Upload the build without making it live. Defaults to false, which deploys and promotes in one step.

Response

deployment started

app_idstring required

The app being deployed, prefixed app_.

build_idstring nullable required

The build the deployment produced, prefixed abld_, or null until it succeeds.

draftboolean required

Whether the running or last deployment uploaded a build without making it live.

errorstring nullable required

Why the deployment failed, or null when it did not.

estimated_duration_msinteger nullable required

How long this deployment is expected to take in total, estimated from previous runs.

estimated_remaining_msinteger nullable required

How much longer the deployment is expected to take. Held above zero until it actually finishes.

finished_atinteger nullable required

When the deployment ended, in milliseconds since the epoch, or null while it is still running.

phase'install' | 'build' | 'typecheck' | 'upload_build' | 'upload_source' | 'process_archive' | 'create_build' | 'promote' | 'null' nullable required

The stage a running deployment has reached, or null when none is running. Later phases dominate the wall clock: process_archive waits on the upload pipeline and promote waits for the build to go live.

progressnumber nullable required

Fraction of the deployment estimated to be complete, from 0 to 1. Stops just short of 1 until the run ends.

started_atinteger nullable required

When the deployment began, in milliseconds since the epoch, or null when none has run.

status'published' | 'unpublished' | 'publishing' | 'failed' | 'no_source' required

Whether the app has anything to publish, and what a publish in flight is doing. unpublished means publishing would ship something new; no_source means the sandbox holds no copy of this app, so there is nothing to publish from.

urlstring nullable required

Where the deployed site is served, or null unless the deployment went live.

Example response

{
  "app_id": "app_xxxxxxxxxxxxxx",
  "estimated_duration_ms": 150000,
  "estimated_remaining_ms": 91000,
  "phase": "process_archive",
  "progress": 0.39,
  "started_at": 1767268800000,
  "status": "publishing"
}