Documentation menu

Upgrade template deployment

POSThttps://api.instacloud.com/projects/{projectId}/template-deployments/{deploymentId}/upgrade

Token scope: account · org · project — read-only tokens refused (not a GET).

Move a deployed template instance to the version the registry serves now (async — poll GET /template-deployments/:id). The SAME services are reused: image, port, start command, always-on, public access, the volume mount path and the variables are all rewritten from the new manifest, a service the new version adds is created, and a service it drops is left running. A volume the new version adds to an existing service is attached at this plan's size and mounted by the run's own deploy; an existing volume is never resized, because a manifest cannot declare a size. Public access on a STORAGE service is lineage-wide — it sets that bucket public on every branch that has a copy, not only this one, and the preview's row for the field says so. Send expectedVersion/expectedDigest from the preview so a republish between review and apply is refused rather than run.

Parameters

NameInTypeRequiredDescription
projectIdpathstringyes
deploymentIdpathstringyes

Request body

application/json

FieldTypeRequiredDescription
variablesobjectnovalues for required variables the new version adds; existing values are recovered and need not be resent
expectedVersionstringnothe version the caller reviewed; a different one in the registry answers 409 template_version_changed
expectedDigeststringnothe to_digest from the preview; a different one answers 409 template_version_changed

Responses

202

Default Response

FieldTypeRequiredDescription
deploymentIdstringno
deploymentobjectnoOne server-side template deployment run and its progress.
deployment.idstringno
deployment.status"running" | "succeeded" | "failed" | "partial"nopartial = some services came up healthy, others failed — created resources are kept either way
deployment.step"create_services" | "write_variables" | "deploy" | "health_check"nothe pipeline step the run is currently on (or stopped at)
deployment.templateCodestringno
deployment.templateVersionstringno
deployment.projectIdstringno
deployment.branchIdstringno
deployment.regionstringnoInstaCloud region slug every service of this deployment was created in. Deployments recorded before regions were recorded read as the platform default.
deployment.servicesobject[]no
deployment.services.namestringnothe service's actual name on the branch, which is the manifest's name only for the first copy — a second deployment of the same template into the same branch names its services <name>-2 and leaves the first copy alone
deployment.services.serviceIdstringno
deployment.services.urlstringno
deployment.services.state"pending" | "created" | "deployed" | "healthy" | "failed"no
deployment.services.skippedbooleannoan upgrade stepped over this service because the user had deleted it — the run never touched it, serviceId points at the deleted row, and state stays pending however the deployment ends. Not "still in progress"
deployment.errorstringno
deployment.logsTailstringnocontainer log tail captured when a service never became healthy
deployment.rollbackToobjectnothe version one step back, present only when this deployment was produced by an upgrade: what POST .../rollback would return the instance to. Absent on a first deploy, once the predecessor is gone, and on a deployment a ROLLBACK produced — that row's step back is the newer version it just left, which is offered as the update, not as a way back. Present is not a promise it will succeed — a version whose manifest is no longer recorded, or was republished with different content, still refuses at click time
deployment.rollbackTo.versionstringyes
deployment.createdAtstringno
status"approval_required"no
approvalIdstringno
actionstringno
actionsstring[]no
messagestringno
urlstringno
nextActionsobject[]no
nextActions.opstringyesNeutral logical action id, e.g. "service.add" — NOT an operationId or a CLI/MCP tool name; each client maps it to its own surface.
nextActions.reasonstringyesNatural-language, human/LLM-facing "why do this now".
nextActions.argsobjectnoSuggested, flat named arguments; "<placeholder>"s where a value is unknown.
nextActions.gatedbooleannoTrue if the action passes a governance gate.

400

Default Response

FieldTypeRequiredDescription
errorstringyes
missingobject[]no
missing.namestringyes
missing.keystringyes
missing.descriptionstringno

403

Default Response

FieldTypeRequiredDescription
errorstringyes

404

Default Response

FieldTypeRequiredDescription
errorstringyes

409

code template_version_changed: republished since the review. code template_up_to_date: already running this content. code template_not_served: off the catalog. code template_no_services: the deployment owns nothing to upgrade. code template_superseded: this instance already moved off this deployment — the message names the one to act on instead

FieldTypeRequiredDescription
errorstringyes
codestringnostable machine-readable reason, e.g. private_lane_disabled, private_lane_unavailable_in_region, public_access_closed, credential_change_in_progress

View as Markdown