Activate (Promote / Roll back / Restart)

POST /v1/applications/{uuid}/deploys/{deploy_uuid}/activate

Make a built deploy the live one (the app's current_deploy_uuid). This one call covers three moves — there is no separate promote endpoint:

  • Promote to production — activate a newer built-but-not-live candidate (one deployed with activate=false) once you've reviewed its preview.
  • Roll back — activate an older built version to return production to it.
  • Restart / roll out — activate the current version to re-ship it (managed backends re-roll the running pod; useful to pick up new env vars).

Works on any deploy the deploy list marks rollbackable — a terminal, non-pruned version that isn't already the live one. A newer candidate reads as “Promote to production” in the dashboard, an older one as “Roll back to this version”; both are this same request. The build worker auto-activates the first successful deploy (unless it was built as a candidate), so you call this to switch versions afterward.

Only a deploy that has already been built can be activated — its status must be ready, superseded, or (managed apps) image_ready. A queued / processing / building / failed deploy is rejected with 409.

“Live” needs a production endpoint. Promote, roll back, and roll out all move an app's production version — which only exists once the app has an endpoint attached (its prod URL). An app that has deploys but no attached endpoint has nothing “live”: its deploys are just builds with preview URLs. Attach a domain / endpoint to give it a production URL.

What happens depends on the app type

  • Static apps — the edge serves the current deploy's built bundle directly, so activation (promote, roll back, or roll out) is an atomic pointer flip (plus an edge pre-warm). No rebuild, no downtime. The response returns { "status": "ok", "current_deploy_uuid": … } and the previously-live deploy is marked superseded.
  • Managed / fullstack apps — the running pod is whatever the runtime last reconciled, so activation re-enqueues the deploy as image_ready. The worker re-points the Deployment at that deploy's already scanned + signed, digest-pinned image, re-materializes env vars, and advances the live version only on a proven-ready rollout. The response returns { "status": "rolling_out", "deploy_uuid": … }. Rollback is instant because the image is immutable and digest-pinned.
Pruned versions can't be rolled back to. Retention keeps only the newest N terminal deploys rollbackable (deploy_max_rollback_versions). Once a deploy's build artifact is pruned (its static bundle or OCI image is deleted), activating it returns 409 — re-deploy from source instead. Check the rollbackable / pruned fields on the deploy list before offering a rollback.

Response (200 OK)

status string
ok (static) or rolling_out (managed / fullstack).
current_deploy_uuid string (uuid)
Static apps: the now-live deploy.
deploy_uuid string (uuid)
Managed / fullstack apps: the deploy now rolling out (the live version advances once the rollout is proven ready).

Deprecated: until the sunset this response also carries the legacy integer current_deploy_id / deploy_id field. Don't use it; read the *_uuid field.

Errors

404
Deploy not found or belongs to another application.
409
The deploy has no built image / bundle to activate (still building or failed), or its build artifacts were pruned by the retention policy and it can no longer be rolled back to.
Request — promote / roll back / restart
curl -X POST \ "https://api.ngris.com/v1/applications/019be838-d261-7d9b-9499-71995a3a91c6/deploys/019bf3d2-0116-7612-9567-75a812bf45fc/activate" \ -H "X-API-KEY: <your_api_key>"
Response — 200 OK (static)
{ "status": "ok", "current_deploy_uuid": "019bf3d2-0116-7612-9567-75a812bf45fc" }
Response — 200 OK (managed / fullstack)
{ "status": "rolling_out", "deploy_uuid": "019bf3d2-0116-7612-9567-75a812bf45fc" }
Response — 409 (pruned version)
{ "error": "This version's build artifacts were pruned by the retention policy (keeps the newest N versions); it can no longer be rolled back to. Re-deploy from source." }