Documentation menu

Create template deployment

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

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

Deploy a template onto a branch (async — poll GET /template-deployments/:id). Omit branch/branchId for a fresh branch named after the template. Deploying the same template into a branch that already runs it builds an INDEPENDENT copy — its services are named <name>-2, <name>-3 … and the existing copy is untouched — so the names in the response need not match the manifest. Gated — service.add + secrets.write + deploy, plus service.upgrade when the manifest declares a volume and service.setAccess when it declares a public bucket. Idempotent per (deploymentId, manifest): duplicate/mid-run re-invokes answer 202 with the current row.

Parameters

NameInTypeRequiredDescription
projectIdpathstringyes

Request body

application/json

FieldTypeRequiredDescription
templateCodestringnoa published registry code (see GET /templates); mutually implied with manifest — one of the two is required
codestringnoalias of templateCode
templateVersionstringnooptional pin; 404s when the registry serves a different version
manifestanynoinline insta.template.yaml for a local-manifest deploy — the YAML text, or the parsed JSON document
branchIdstringno
branchstringnobranch NAME (alias of branchId). Omit both for a fresh branch named after the template code
variablesobjectnodeploy-time variable values (required/optional env vars declared by the manifest)
deploymentIdstringnoidempotent retry: resume THIS deployment (same services, no duplicates) instead of starting a new one
regionstringnoInstaCloud region slug for EVERY service this deployment creates (see GET /regions). Default: the platform default region. Part of the deployment identity: a retry may omit it or repeat it, a different value is refused with 409.

Responses

202

accepted (deploymentId + deployment to poll) — or approval_required from the governance gate

FieldTypeRequiredDescription
deploymentIdstringnopresent when the deployment was accepted
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
actionstringnothe gated action, or a comma-joined compound set — prefer `actions`
actionsstring[]noevery capability this approval covers
messagestringno
urlstringnothe console page where a project admin reviews this request
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[]noerror='missing_variables': the required variables that resolved to no value
missing.namestringyes
missing.keystringyes
missing.descriptionstringno

403

Default Response

FieldTypeRequiredDescription
errorstringyes

404

Default Response

FieldTypeRequiredDescription
errorstringyes

409

the run is still in progress; the branch already holds the maximum number of copies of this template; or a service name is too long to suffix for another copy. Also code template_version_changed: the template was republished since it was read, fetch it again.

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

429

Default Response

FieldTypeRequiredDescription
errorstringyes

View as Markdown