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

# Trigger compose file update

> Applies a provisioned compose file update. Requires compose_hash from provision endpoint. Restarts the CVM with new configuration.



## OpenAPI

````yaml /openapi.json patch /api/v1/cvms/{cvm_id}/compose_file
openapi: 3.1.0
info:
  title: Phala Cloud API
  version: 0.1.0
servers:
  - url: https://cloud-api.phala.com
security: []
tags:
  - name: CVMs
    description: Confidential Virtual Machine (CVM) lifecycle management on Phala Network
  - name: Apps
    description: App template management and CVM deployment from app blueprints
  - name: Webhooks
    description: Manage webhook endpoints and monitor delivery history
  - name: SSH Keys
    description: SSH public key management for CVM access
  - name: KMS
    description: >-
      Key Management Service — key derivation, on-chain anchoring, and
      inspection
  - name: Instance Types
    description: Available hardware configurations for CVM deployment
  - name: Attestations
    description: Remote attestation and TEE verification endpoints
paths:
  /api/v1/cvms/{cvm_id}/compose_file:
    patch:
      tags:
        - CVMs
      summary: Trigger compose file update
      description: >-
        Applies a provisioned compose file update. Requires compose_hash from
        provision endpoint. Restarts the CVM with new configuration.
      operationId: trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch
      parameters:
        - name: cvm_id
          in: path
          required: true
          schema:
            type: string
            title: Cvm Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Body_trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch
      responses:
        '202':
          description: Update initiated
          content:
            application/json:
              schema: {}
        '400':
          description: Provision not found or invalid CVM
        '401':
          description: Authentication required
        '403':
          description: CVM not in workspace
        '404':
          description: CVM not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: Node under maintenance
components:
  schemas:
    Body_trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch:
      properties:
        compose_hash:
          type: string
          title: Compose Hash
          description: Hash from provision response
        encrypted_env:
          anyOf:
            - type: string
            - type: 'null'
          title: Encrypted Env
          description: New encrypted env blob (hex)
        env_keys:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Env Keys
          description: Allowed env var names
        update_env_vars:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Update Env Vars
          description: Update allowed_envs list
          default: false
      type: object
      required:
        - compose_hash
      title: >-
        Body_trigger_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_patch
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````