> ## 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.

# Stop container

> Stops the container, keeping its configuration and volumes so it can be deployed again. Stopping a Perimeter also stops the Bunkers that route through it.



## OpenAPI

````yaml https://api.tinfoil.sh/openapi.yaml post /api/containers/{id}/stop
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}/stop:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
    post:
      tags:
        - Containers
      summary: Stop container
      description: >-
        Stops the container, keeping its configuration and volumes so it can be
        deployed again. Stopping a Perimeter also stops the Bunkers that route
        through it.
      operationId: stopContainer
      responses:
        '200':
          description: Container in the stopping state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Container'
        '400':
          $ref: '#/components/responses/Error'
          description: Invalid request
        '401':
          $ref: '#/components/responses/Error'
          description: Missing or invalid credentials
        '403':
          $ref: '#/components/responses/Error'
          description: Not permitted
        '404':
          $ref: '#/components/responses/Error'
          description: Not found
        '409':
          $ref: '#/components/responses/Error'
          description: Conflicts with the current state
        '500':
          $ref: '#/components/responses/Error'
          description: Server error
      security:
        - apiKey:
            - containers.stop
components:
  schemas:
    Container:
      type: object
      description: A container, Bunker or Monitor.
      required:
        - id
        - name
        - repo
        - config_name
        - source
        - current_tag
        - status
        - host_id
        - domain
        - cpus
        - gpus
        - memory_mb
        - config
        - variables
        - secrets
        - ssh_keys
        - stale_secrets
        - debug
        - held
        - github_app_connected
        - repo_status
        - update_tag
        - update_status
        - update_type
        - internal_domain
        - project_id
        - deploy_started_at
        - deploy_completed_at
        - update_started_at
        - update_completed_at
        - boot_stages
        - update_boot_stages
        - error_message
        - mark_latest_release
        - created_at
        - updated_at
        - last_deploy_attempt_tag
        - last_deploy_attempt_error
        - last_deploy_attempt_at
        - sandbox
        - purpose
        - network_policy
        - owner_key_mode
        - update_strategy
        - connections
        - owner_public_key
        - clerk_user_id
        - clerk_org_id
        - disable_cc_mode
        - display_order
        - tinfoild_deployment_id
        - update_config
        - update_deployment_id
      properties:
        id:
          type:
            - string
            - 'null'
          format: uuid
        name:
          type: string
        repo:
          type:
            - string
            - 'null'
          description: >-
            Source repository. For a container rendered from a template, the
            template repository.
        config_name:
          type:
            - string
            - 'null'
          description: Config registry name backing the deployment, when config-backed.
        source:
          type: string
          enum:
            - github
            - registry
            - local
        current_tag:
          type:
            - string
            - 'null'
          description: >-
            Deployed version. For a container rendered from a template, the
            template version.
        status:
          type: string
          enum:
            - created
            - pending
            - deploying
            - started
            - running
            - failed
            - stopping
            - stopped
        host_id:
          type:
            - string
            - 'null'
          format: uuid
        domain:
          type:
            - string
            - 'null'
          description: >-
            Domain the container serves on; the custom domain when set,
            otherwise internal_domain.
        cpus:
          type: integer
          description: >-
            CPU count from the measured tinfoil-config.yml of the deployed
            release; requests cannot override it.
        gpus:
          type: integer
          description: >-
            GPU count from the measured tinfoil-config.yml of the deployed
            release; requests cannot override it.
        memory_mb:
          type:
            - integer
            - 'null'
          description: >-
            Memory from the measured tinfoil-config.yml of the deployed release;
            requests cannot override it.
        config:
          type:
            - string
            - 'null'
          description: Saved tinfoil-config.yml contents.
        variables:
          type:
            - string
            - 'null'
          format: byte
          description: Base64-encoded JSON object mapping variable names to values.
        secrets:
          type:
            - array
            - 'null'
          description: Names of the secrets the container uses.
          items:
            type: string
        ssh_keys:
          type:
            - array
            - 'null'
          description: Names of the SSH keys installed in the container.
          items:
            type: string
        stale_secrets:
          type:
            - array
            - 'null'
          description: Secrets changed since the container was deployed.
          items:
            type: string
        debug:
          type: boolean
        held:
          type: boolean
          description: Whether updates are held for review before going live.
        github_app_connected:
          type: boolean
        repo_status:
          type: string
          enum:
            - active
            - deleted
            - archived
            - privatized
        update_tag:
          type:
            - string
            - 'null'
          description: Version an in-progress update deploys.
        update_status:
          type:
            - string
            - 'null'
          description: Status of the in-progress update deployment.
        update_type:
          type:
            - string
            - 'null'
          enum:
            - blue_green
            - replace
            - queued_deploy
            - null
          description: How the in-progress update replaces the running container.
        internal_domain:
          type: string
        project_id:
          type:
            - string
            - 'null'
          format: uuid
        deploy_started_at:
          type:
            - string
            - 'null'
          format: date-time
        deploy_completed_at:
          type:
            - string
            - 'null'
          format: date-time
        update_started_at:
          type:
            - string
            - 'null'
          format: date-time
        update_completed_at:
          type:
            - string
            - 'null'
          format: date-time
        boot_stages:
          description: >-
            Boot progress reported by the deployment as JSON, or null when none
            was reported.
        update_boot_stages:
          description: >-
            Boot progress reported by the update deployment as JSON, or null
            when none was reported.
        error_message:
          type:
            - string
            - 'null'
        mark_latest_release:
          type: boolean
          description: >-
            Whether a deployed version is marked as the repository's latest
            GitHub release.
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        ssh_port:
          type: integer
          description: Published SSH port of the active deployment; omitted when none.
        update_ssh_port:
          type: integer
          description: Published SSH port of the update deployment; omitted when none.
        last_deploy_attempt_tag:
          type:
            - string
            - 'null'
        last_deploy_attempt_error:
          type:
            - string
            - 'null'
        last_deploy_attempt_at:
          type:
            - string
            - 'null'
          format: date-time
        sandbox:
          type: boolean
        purpose:
          type: string
          enum:
            - production
            - rnd
        network_policy:
          description: Saved network policy, or null when none is set.
          anyOf:
            - $ref: '#/components/schemas/ContainerNetworkPolicy'
            - type: 'null'
        owner_key_mode:
          type:
            - string
            - 'null'
          enum:
            - tmk
            - umk
            - null
          description: >-
            Who holds the owner key of a Bunker or Monitor; null unless
            owner_public_key is set.
        supports_version_change:
          type: boolean
          description: >-
            Whether a template-rendered container can change version; omitted
            when false.
        host_name:
          type: string
          description: Display name of the container's host; omitted when unknown.
        update_host_name:
          type: string
          description: >-
            Host an in-progress update moves the container to; omitted when it
            stays on the same host.
        host_gpu_type:
          type: string
          description: >-
            GPU type of the container's host; omitted for hosts without GPUs or
            when unknown.
        host_cpu_type:
          type: string
          description: CPU type of the container's host; omitted when unknown.
        volumes:
          type: object
          description: >-
            Volume ID attached to each mount name. Only returned by the
            single-container view, and omitted when none are attached.
          additionalProperties:
            type: string
            format: uuid
        volume_slots:
          type: array
          description: Volume mounts the container's config declares.
          items:
            $ref: '#/components/schemas/VolumeSlot'
        update_strategy:
          type: string
          enum:
            - blue_green
            - replace
          description: >-
            Whether an update boots a candidate alongside the running container
            (blue_green) or must stop it first (replace), causing downtime.
            Derived from the saved configuration; an update's target release may
            require a different strategy, which the update plan reports.
        connections:
          $ref: '#/components/schemas/ContainerConnections'
        object_storage:
          $ref: '#/components/schemas/ObjectStorageBinding'
        owner_public_key:
          type:
            - string
            - 'null'
          description: Owner public key measured into a Bunker or Monitor.
        clerk_user_id:
          type:
            - string
            - 'null'
          description: ID of the user who created the container.
        clerk_org_id:
          type:
            - string
            - 'null'
          description: >-
            ID of the organization that owns the container, or null for a
            personal container.
        disable_cc_mode:
          type: boolean
          description: >-
            Whether the container was launched with confidential computing mode
            turned off.
        display_order:
          type: integer
          description: Position of the container within its project.
        tinfoild_deployment_id:
          type:
            - string
            - 'null'
          description: ID of the container's deployment on its host.
        update_config:
          type:
            - object
            - 'null'
          description: >-
            Configuration a pending update relaunches the container with, such
            as variables, secrets, ssh_keys, cpus and memory_mb.
        update_deployment_id:
          type:
            - string
            - 'null'
          description: >-
            ID of the update candidate's deployment on its host while an update
            runs.
    ContainerNetworkPolicy:
      type: object
      description: >-
        Network policy of a production container. Responses always include
        public, egress_mode and egress.
      properties:
        public:
          type: boolean
        egress_mode:
          type: string
          enum:
            - restricted
            - unrestricted
          description: Defaults to restricted.
        egress:
          type:
            - array
            - 'null'
          description: Containers this one may reach.
          items:
            $ref: '#/components/schemas/ContainerNetworkPeer'
        destinations:
          type: array
          description: Public IPv4 ranges this container may reach.
          items:
            $ref: '#/components/schemas/NetworkDestination'
    VolumeSlot:
      type: object
      required:
        - name
      properties:
        name:
          type: string
        size:
          type: string
        key_secret:
          type: string
          description: >-
            Secret holding the volume's key; a mount with one must have a volume
            attached before deploying.
    ContainerConnections:
      type: object
      description: >-
        Endpoints of the container. Connect with a verifying client; opening a
        URL does not verify attestation, and a debug container is not
        confidential.
      required:
        - production
        - review
      properties:
        production:
          description: Endpoint of the running deployment, or null when not serving.
          anyOf:
            - $ref: '#/components/schemas/ContainerConnection'
            - type: 'null'
        review:
          description: >-
            Endpoint of the current blue/green update candidate on its review
            port, with the target tag, while the candidate's update_status is
            started or ready; otherwise null.
          anyOf:
            - $ref: '#/components/schemas/ContainerConnection'
            - type: 'null'
    ObjectStorageBinding:
      type: object
      required:
        - id
        - bucket_url
        - credentials_url
      properties:
        id:
          type: string
        bucket_url:
          type: string
        credentials_url:
          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
    ContainerNetworkPeer:
      type: object
      required:
        - container_id
        - port
      properties:
        container_id:
          type: string
          format: uuid
        port:
          type: integer
          minimum: 1
          maximum: 65535
        alias:
          $ref: '#/components/schemas/NetworkAlias'
    NetworkDestination:
      type: object
      required:
        - cidr
        - protocol
        - port
      properties:
        name:
          type: string
          description: Hostname resolved only to addresses inside cidr.
        cidr:
          type: string
          description: Public IPv4 prefix.
        protocol:
          type: string
          description: tcp or udp.
        port:
          type: integer
    ContainerConnection:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
        repo:
          type: string
        tag:
          type: string
        config_name:
          type: string
          description: Config registry name, for a config-backed deployment.
        config_digest:
          type: string
          description: >-
            Hex SHA-256 digest of the deployed config, for a config-backed
            deployment.
    NetworkAlias:
      type: object
      description: >-
        Public IPv4 address and port at which the peer is reachable from inside
        the container. At most one per policy.
      required:
        - ip
        - port
      properties:
        ip:
          type: string
        port:
          type: integer
          minimum: 1
          maximum: 65535
        target:
          type: string
          description: Set by the server; ignored on input.
  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.