Documentation menu

Rollback template deployment

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

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

Return a deployed template instance to the version it was upgraded from — one step, from wherever it is now (async — poll GET /template-deployments/:id). Restores the image, start command, port, always-on, public access, the volume mount path and recorded variables from the older manifest. An existing volume is never resized. Public access on a STORAGE service is lineage-wide: it sets that bucket's access on every branch that has a copy. It does NOT restore data: an app that migrated its own database under the newer version cannot read it back, and a volume only grows.

Parameters

NameInTypeRequiredDescription
projectIdpathstringyes
deploymentIdpathstringyes

Request body

application/json

FieldTypeRequiredDescription
variablesobjectnovalues for required variables the older version needs that the instance no longer holds — an upgrade to a version that stopped declaring a variable DELETES its value, and the older manifest still requires it. Everything the services still hold is recovered and need not be resent; a 400 missing_variables names exactly what to send here

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_no_step_back: this instance was not upgraded from anything, or it is itself the result of a rollback and the version it came from is the newer one. code template_version_not_recorded: the manifest for that version is no longer recorded. code template_version_content_changed: that version was republished with different content after this instance ran it, so the recorded manifest is not what it was running. code template_no_services: the deployment owns nothing to roll back. 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