> ## Documentation Index
> Fetch the complete documentation index at: https://docs.instacloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview template upgrade

> **Token scope:** `account` · `org` · `project` — read-only tokens allowed.

What upgrading this deployment to the version the registry serves now would do: per-service field changes, which of them the upgrade writes and which it only reports, required variables with no value yet, and anything that makes the upgrade impossible. Each field row carries the label to show for it — render that label as given, because it is where a change states how far it reaches (public access on a storage service applies to that bucket on every branch). Reads only.



## OpenAPI

````yaml /openapi/project.json get /template-deployments/{deploymentId}/upgrade
openapi: 3.1.0
info:
  title: InstaCloud API — Project level
  version: 0.1.0
  description: >-
    Endpoints under `/projects/{projectId}`: branches, services, deploys,
    secrets, databases, storage, cron, observability, governance. Callable with
    any token whose binding covers the project.


    Generated from the platform's own OpenAPI document
    (https://api.instacloud.com/openapi.json); see the [API
    overview](/reference/api/overview) for authentication and token scopes.
servers:
  - url: https://api.instacloud.com
    description: InstaCloud
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Projects inside an organization.
  - name: Branches
    description: >-
      Branch environments of a project: isolated database, storage and compute
      per branch.
  - name: Services
    description: 'Services on a branch: compute, postgres, storage and managed databases.'
  - name: Deploy
    description: Deploy an image or a source to a compute service.
  - name: Compute
    description: Build output of a compute service.
  - name: Secrets
    description: User secrets, service credentials and how they bind into compute env.
  - name: Database
    description: Postgres databases, extensions, credentials and ad-hoc SQL.
  - name: Storage
    description: Objects in a storage service.
  - name: Backups
    description: Database backups and restores.
  - name: Cron
    description: Scheduled HTTP calls against a service or an external URL.
  - name: Observability
    description: Logs, metrics, deploy events and database insight.
  - name: Governance
    description: Per-project agent policy and the approval queue.
  - name: Audit
    description: The project's event timeline, including agent-ingested events.
  - name: Domains
    description: >-
      Domains bought through InstaCloud, bring-your-own zones and their DNS
      records.
  - name: Billing
    description: Usage, cycles, invoices and credits.
  - name: Templates
    description: Deploy a template into a project.
paths:
  /template-deployments/{deploymentId}/upgrade:
    get:
      tags:
        - Templates
      summary: Preview template upgrade
      description: >-
        **Token scope:** `account` · `org` · `project` — read-only tokens
        allowed.


        What upgrading this deployment to the version the registry serves now
        would do: per-service field changes, which of them the upgrade writes
        and which it only reports, required variables with no value yet, and
        anything that makes the upgrade impossible. Each field row carries the
        label to show for it — render that label as given, because it is where a
        change states how far it reaches (public access on a storage service
        applies to that bucket on every branch). Reads only.
      operationId: previewTemplateUpgrade
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: deploymentId
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  plan:
                    $ref: '#/components/schemas/TemplateUpgradePlan'
                required:
                  - plan
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            code template_not_served: the registry no longer serves this
            template. code template_up_to_date: the instance already runs the
            content the registry publishes. code template_superseded: this
            instance already moved off this deployment — the message names the
            one to act on instead
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodedError'
components:
  schemas:
    TemplateUpgradePlan:
      type: object
      properties:
        from_version:
          description: the version this instance was deployed from
          type: string
        to_version:
          description: the version the registry serves now
          type: string
        to_digest:
          description: >-
            content digest of the manifest this plan was computed from, send it
            back as expected_digest so the apply cannot run a version nobody
            reviewed
          type: string
        services:
          type: array
          items:
            type: object
            properties:
              key:
                description: >-
                  the manifest key; stable across copies, where the platform
                  name may be <key>-2
                type: string
              service_id:
                type:
                  - string
                  - 'null'
              service_name:
                type:
                  - string
                  - 'null'
              gone:
                description: >-
                  the deployment created it and the branch no longer has it: the
                  user deleted it. Reported, never recreated
                type: boolean
              added:
                description: the new version introduces it; the upgrade creates it
                type: boolean
              fields:
                description: >-
                  what the upgrade will write on this service. On an `added`
                  service these are the values it will be CREATED with, so
                  `deployed` and `live` are null and `drifted` is false; a field
                  the manifest does not declare gets no row and takes the
                  platform default
                type: array
                items:
                  type: object
                  properties:
                    field:
                      description: >-
                        the `services` column this concerns — image, port,
                        start_command, always_on, public, volume_gib (the new
                        version adds a volume; it is attached at this plan's
                        size) or volume_mount_path — so a client can deep-link
                        to the setting
                      type: string
                    label:
                      description: >-
                        what to show for this row. Render it as given: it is
                        where a field states how far its change reaches, e.g.
                        public access on a storage bucket applies to that bucket
                        on every branch
                      type: string
                    deployed:
                      type:
                        - string
                        - 'null'
                    live:
                      type:
                        - string
                        - 'null'
                    next:
                      type:
                        - string
                        - 'null'
                    drifted:
                      description: >-
                        the live value differs from what the deployment
                        recorded: the user changed it after deploying
                      type: boolean
                    verdict:
                      type: string
                      enum:
                        - applied
                        - refused
                      description: >-
                        applied: the upgrade writes it, which covers everything
                        a manifest can declare for a service it keeps and for
                        one it creates. refused: it cannot be changed in place
                        at all, and refuses the whole upgrade
                  required:
                    - field
                    - label
                    - drifted
                    - verdict
              missing_variables:
                type: array
                items:
                  description: >-
                    required variables the new version needs that this instance
                    has no value for
                  type: string
            required:
              - key
              - gone
              - added
              - fields
              - missing_variables
        removed:
          type: array
          items:
            description: >-
              manifest keys the deployment created that the new version no
              longer declares. Left running
            type: string
        refusals:
          type: array
          items:
            description: non-empty means the upgrade cannot run at all
            type: string
      required:
        - from_version
        - to_version
        - to_digest
        - services
        - removed
        - refusals
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    CodedError:
      type: object
      properties:
        error:
          type: string
        code:
          description: >-
            stable machine-readable reason, e.g. private_lane_disabled,
            private_lane_unavailable_in_region, public_access_closed,
            credential_change_in_progress
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Session access JWT or an API token (`insta_<prefix>_<secret>`).

````