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

# Plan a container update

> Previews what the update would do without changing anything.



## OpenAPI

````yaml https://api.tinfoil.sh/openapi.yaml post /api/containers/{id}/update/plan
openapi: 3.2.0
info:
  title: Tinfoil Controlplane API
  version: 0.1.0
  description: >-
    Manage inference API keys, read usage and invoices, and manage Tinfoil
    confidential containers, their configuration, and the organization resources
    they use. Authenticate with an admin API key sent as a bearer token.
servers:
  - url: https://api.tinfoil.sh
security:
  - apiKey: []
tags:
  - name: Account
    description: >-
      The identity and organization behind the API key, and the token usage and
      invoices of the personal account or organization.
  - name: API keys
    parent: Account
    description: Inference API keys of the personal account or organization.
  - name: Containers
    description: Create, deploy, and stop confidential containers.
  - name: Container updates
    description: >-
      Move a container to a new release, and promote or cancel an update that is
      held for review.
  - name: Projects
    description: Groups of containers deployed from the same config source.
  - name: Volumes
    description: Encrypted persistent volumes that attach to containers.
  - name: Secrets
    description: >-
      Organization secrets available to containers, and secrets scoped to a
      single GitHub repository.
  - name: Access
    description: >-
      SSH public keys for attested SSH access to containers, custom domains that
      route to containers, and credentials for pulling images from private
      registries. An organization can store one ecr and one custom registry
      connection, each identified by its hostname.
  - name: GitHub & models
    description: >-
      Repository config and image builds through the Tinfoil GitHub app, and
      packaging Hugging Face models for use in containers. Packaging models
      requires a GPU entitlement or model access for the organization.
  - name: Config registry
    description: >-
      Publish tinfoil-config.yml revisions, read published configs, and resolve
      the endorsements that let clients verify them.
  - name: Bunkers
    description: Bunker owner keys and owner attestation.
paths:
  /api/containers/{id}/update/plan:
    post:
      tags:
        - Container updates
      summary: Plan a container update
      description: Previews what the update would do without changing anything.
      operationId: planContainerUpdate
      parameters:
        - name: id
          in: path
          required: true
          description: Container ID.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContainerUpdateRequest'
      responses:
        '200':
          description: Update plan.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerUpdatePlan'
        '400':
          $ref: '#/components/responses/Error'
          description: Bad request
        '401':
          $ref: '#/components/responses/Error'
          description: Unauthorized
        '402':
          $ref: '#/components/responses/Error'
          description: Payment required
        '403':
          $ref: '#/components/responses/Error'
          description: Forbidden
        '404':
          $ref: '#/components/responses/Error'
          description: Not found
        '409':
          $ref: '#/components/responses/Error'
          description: Conflict
        '503':
          $ref: '#/components/responses/Error'
          description: Service unavailable
      security:
        - apiKey:
            - containers.update
components:
  schemas:
    ContainerUpdateRequest:
      type: object
      description: >-
        All fields are optional; omitted fields keep the container's current
        values.
      properties:
        tag:
          type: string
          description: Release tag to deploy. Omitted keeps the current tag.
        variables:
          type:
            - object
            - 'null'
          description: >-
            Replaces the saved variables, not env values measured in
            tinfoil-config.yml.
          additionalProperties:
            type: string
        secrets:
          type:
            - array
            - 'null'
          description: >-
            Names of Tinfoil-managed secrets to attach. Omitted or null keeps
            the saved selection; a list replaces it, and secrets the config
            declares that exist in repository or organization scope are added.
            Non-debug private keyserver delivery requires an empty list, and
            private secret names supplied as variables are rejected.
          items:
            type: string
        ssh_keys:
          type:
            - array
            - 'null'
          description: Names of SSH keys to attach; replaces the saved list.
          items:
            type: string
        debug:
          type:
            - boolean
            - 'null'
        mark_latest_release:
          type:
            - boolean
            - 'null'
          description: >-
            Mark a changed tag as the GitHub latest release. Omitted means true.
            For a held update, the tag is marked after promotion. Applies only
            to non-debug containers whose repository is active and connected
            through the GitHub App.
        custom_domain:
          type:
            - string
            - 'null'
          description: >-
            Verified custom domain to serve the container on; an empty string
            reverts to the generated domain.
        host_name:
          type:
            - string
            - 'null'
          description: >-
            Move a running container to this host without downtime. Must be the
            only change in the request. Only containers that update blue/green,
            do not use the HTTP certificate challenge, and are on a host that
            supports handover can move; otherwise the request returns 409 with
            code MOVE_UNAVAILABLE, and the container must be stopped and
            deployed with host_name.
        hold:
          type:
            - boolean
            - 'null'
          description: >-
            Hold the new version for review instead of switching traffic.
            Omitted inherits the project's hold_by_default. Available only for
            blue/green updates; otherwise the request returns 400 with code
            HOLD_UNAVAILABLE. An explicit value applies to this update only and
            does not change the project setting.
        confirm_downtime:
          type: boolean
          description: >-
            Must be true when the update replaces the running container. Without
            it, such an update returns 409 with code
            DOWNTIME_CONFIRMATION_REQUIRED and does not begin.
    ContainerUpdatePlan:
      type: object
      required:
        - read_only
        - instance_id
        - name
        - current
        - target
        - update_strategy
        - downtime_required
        - hold
        - hold_source
        - hold_available
        - mark_latest_release
        - configuration_changes
        - volume_data
        - cost_estimate
      properties:
        secret_delivery:
          type: object
          description: >-
            Present only when the target configuration sets a keyserver URL. Its
            absence does not mean external secrets were verified.
          required:
            - mode
            - managed_secrets
            - external_secrets
            - external_secrets_verified
            - keyserver_ignored_in_debug
          properties:
            mode:
              type: string
              enum:
                - managed
                - private_keyserver
              description: >-
                private_keyserver for a non-debug target; managed for a debug
                target, which ignores the keyserver.
            managed_secrets:
              type: array
              description: >-
                Sorted managed secret names, equal to
                configuration_changes.secrets_refreshed; empty in
                private_keyserver mode.
              items:
                type: string
            external_secrets:
              type: array
              description: >-
                Secret names the container fetches from its private keyserver,
                sorted and deduplicated from the measured containers[].secrets,
                models[].key-secret, and volumes[].key-secret. Empty in managed
                mode.
              items:
                type: string
            external_secrets_verified:
              type: boolean
              description: Always false; planning does not contact the keyserver.
            keyserver_ignored_in_debug:
              type: boolean
              description: >-
                True when a debug target's config sets keyserver-url; delivery
                is then managed and not private.
        read_only:
          type: boolean
        instance_id:
          type: string
          format: uuid
        name:
          type: string
        current:
          $ref: '#/components/schemas/UpdatePlanResources'
        target:
          $ref: '#/components/schemas/UpdatePlanResources'
        update_strategy:
          type: string
          enum:
            - blue_green
            - replace
        downtime_required:
          type: boolean
        hold:
          type: boolean
        hold_source:
          type: string
          enum:
            - project
            - request
        hold_available:
          type: boolean
        mark_latest_release:
          type: boolean
        configuration_changes:
          type: object
          description: Names of changed items only, never values.
          required:
            - variables
            - secrets
            - ssh_keys
            - settings
            - secrets_refreshed
          properties:
            variables:
              $ref: '#/components/schemas/UpdatePlanKeyChanges'
            secrets:
              $ref: '#/components/schemas/UpdatePlanKeyChanges'
            ssh_keys:
              $ref: '#/components/schemas/UpdatePlanKeyChanges'
            settings:
              type: array
              description: Names of changed container settings.
              items:
                type: string
            secrets_refreshed:
              type: array
              description: >-
                Target secret names whose values are fetched fresh when the
                update runs.
              items:
                type: string
        volume_data:
          type: string
          description: What happens to persistent volume data; currently always "retained".
        target_host_name:
          type: string
          description: Host the container moves to, when the update is a move.
        cost_estimate:
          type: object
          description: >-
            available is false, with reason explaining why, when no estimate can
            be given.
          required:
            - available
            - reason
          properties:
            available:
              type: boolean
            reason:
              type: string
    UpdatePlanResources:
      type: object
      required:
        - tag
        - cpus
        - memory_mb
        - gpus
      properties:
        tag:
          type: string
        cpus:
          type: integer
        memory_mb:
          type:
            - integer
            - 'null'
        gpus:
          type: integer
    UpdatePlanKeyChanges:
      type: object
      required:
        - added
        - changed
        - removed
      properties:
        added:
          type: array
          items:
            type: string
        changed:
          type: array
          items:
            type: string
        removed:
          type: array
          items:
            type: string
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: Stable machine-readable error code.
      additionalProperties: true
  responses:
    Error:
      description: The request failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An admin API key. Personal admin keys reach the API key, billing and
        Account endpoints for the creator's personal account; the other
        endpoints need an organization admin key. Security requirement entries
        list the permission a scoped key needs for the operation.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.