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

# Provision compose file update

> Validates new compose file and returns compose_hash for on-chain registration. Cache expires after 14 days.



## OpenAPI

````yaml /openapi.json post /api/v1/cvms/{cvm_id}/compose_file/provision
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/provision:
    post:
      tags:
        - CVMs
      summary: Provision compose file update
      description: >-
        Validates new compose file and returns compose_hash for on-chain
        registration. Cache expires after 14 days.
      operationId: >-
        provision_for_cvm_compose_file_update_api_v1_cvms__cvm_id__compose_file_provision_post
      parameters:
        - name: cvm_id
          in: path
          required: true
          schema:
            type: string
            title: Cvm Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvisionComposeFileUpdateRequest'
              description: Updated compose configuration
      responses:
        '200':
          description: Provision response with compose_hash and KMS info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComposeFileProvisionResponse'
        '400':
          description: Empty Docker Compose file or invalid CVM
        '401':
          description: Authentication required
        '403':
          description: CVM not in workspace
        '404':
          description: CVM not found
        '422':
          description: Invalid Docker Compose syntax
components:
  schemas:
    ProvisionComposeFileUpdateRequest:
      properties:
        allowed_envs:
          items:
            type: string
          type: array
          title: Allowed Envs
        bash_script:
          anyOf:
            - type: string
            - type: 'null'
          title: Bash Script
        default_gateway_domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Gateway Domain
        docker_compose_file:
          anyOf:
            - type: string
            - type: 'null'
          title: Docker Compose File
        init_script:
          anyOf:
            - type: string
            - type: 'null'
          title: Init Script
        kms_enabled:
          type: boolean
          title: Kms Enabled
          default: true
        local_key_provider_enabled:
          type: boolean
          title: Local Key Provider Enabled
          default: false
        manifest_version:
          type: integer
          title: Manifest Version
          default: 2
        name:
          type: string
          title: Name
        no_instance_id:
          type: boolean
          title: No Instance Id
          default: false
        pre_launch_script:
          anyOf:
            - type: string
            - type: 'null'
          title: Pre Launch Script
        public_logs:
          type: boolean
          title: Public Logs
          default: true
        public_sysinfo:
          type: boolean
          title: Public Sysinfo
          default: true
        public_tcbinfo:
          type: boolean
          title: Public Tcbinfo
          default: true
        runner:
          type: string
          title: Runner
          default: docker-compose
        gateway_enabled:
          type: boolean
          title: Gateway Enabled
          default: true
        features:
          items:
            type: string
          type: array
          title: Features
          default:
            - kms
            - tproxy-net
        salt:
          anyOf:
            - type: string
            - type: 'null'
          title: Salt
        secure_time:
          type: boolean
          title: Secure Time
          default: false
        storage_fs:
          anyOf:
            - type: string
              const: ext4
            - type: string
              const: zfs
            - type: 'null'
          title: Storage Fs
          default: zfs
        tproxy_enabled:
          type: boolean
          title: Tproxy Enabled
          default: true
        update_env_vars:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Update Env Vars
          description: Whether to also update allowed_envs
          default: false
      type: object
      required:
        - name
      title: ProvisionComposeFileUpdateRequest
      description: Request model for provisioning compose file updates.
    ComposeFileProvisionResponse:
      properties:
        app_id:
          type: string
          title: App Id
        device_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Device Id
        compose_hash:
          type: string
          title: Compose Hash
        kms_info:
          anyOf:
            - $ref: '#/components/schemas/KMSInfo'
            - type: 'null'
        compose_hash_registered:
          type: boolean
          title: Compose Hash Registered
          default: false
      type: object
      required:
        - app_id
        - compose_hash
      title: ComposeFileProvisionResponse
      description: API response model for compose file provision
    KMSInfo:
      properties:
        id:
          type: string
          pattern: ^kms_.+
          format: hashid
          title: HashedId[kms]
          description: Hashed KMS identifier (kms_xxxxx)
          examples:
            - kms_0123abcd
        slug:
          anyOf:
            - type: string
            - type: 'null'
          title: Slug
          description: Human-readable KMS name
        url:
          type: string
          title: Url
          description: KMS endpoint URL
        version:
          type: string
          title: Version
          description: KMS software version
        chain_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Chain Id
          description: Blockchain chain ID if onchain
        kms_contract_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Kms Contract Address
          description: Smart contract address if onchain
        gateway_app_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Gateway App Id
          description: Gateway application ID
      type: object
      required:
        - id
        - url
        - version
      title: KMSInfo
      description: KMS instance information.

````