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

# Get CVM init scripts

> Lists the platform init scripts (docker_cleanup, env_merge) in their fixed run order: whether the CVM's current compose runs each one, and whether the caller could select it for this CVM, with the reason when not. docker_cleanup needs OS 0.6.x, ext4 storage and the docker-compose runner; env_merge needs OS 0.6.0 or newer and the managed_env_create feature flag.



## OpenAPI

````yaml /openapi.json get /api/v1/cvms/{cvm_id}/init-scripts
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
    x-mint:
      href: https://cloud.phala.network/api-reference/cvms
  - name: Apps
    description: App template management and CVM deployment from app blueprints
    x-mint:
      href: https://cloud.phala.network/api-reference/apps
  - name: Webhooks
    description: Manage webhook endpoints and monitor delivery history
    x-mint:
      href: https://cloud.phala.network/api-reference/webhooks
  - name: SSH Keys
    description: SSH public key management for CVM access
    x-mint:
      href: https://cloud.phala.network/api-reference/ssh-keys
  - name: KMS
    description: >-
      Key Management Service — key derivation, on-chain anchoring, and
      inspection
    x-mint:
      href: https://cloud.phala.network/api-reference/kms
  - name: Instance Types
    description: Available hardware configurations for CVM deployment
    x-mint:
      href: https://cloud.phala.network/api-reference/instance-types
  - name: Attestations
    description: Remote attestation and TEE verification endpoints
    x-mint:
      href: https://cloud.phala.network/api-reference/attestations
paths:
  /api/v1/cvms/{cvm_id}/init-scripts:
    get:
      tags:
        - CVMs
        - cvms-init-scripts
      summary: Get CVM init scripts
      description: >-
        Lists the platform init scripts (docker_cleanup, env_merge) in their
        fixed run order: whether the CVM's current compose runs each one, and
        whether the caller could select it for this CVM, with the reason when
        not. docker_cleanup needs OS 0.6.x, ext4 storage and the docker-compose
        runner; env_merge needs OS 0.6.0 or newer and the managed_env_create
        feature flag.
      operationId: get_cvm_init_scripts_api_v1_cvms__cvm_id__init_scripts_get
      parameters:
        - name: cvm_id
          in: path
          required: true
          schema:
            type: string
            title: Cvm Id
      responses:
        '200':
          description: Init scripts of the CVM
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CvmInitScriptsResponse'
        '401':
          description: Not authenticated
        '404':
          description: CVM not found, or its current compose is unavailable
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CvmInitScriptsResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CvmInitScript'
          type: array
          title: Items
          description: Every platform init script, in run order
      type: object
      required:
        - items
      title: CvmInitScriptsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CvmInitScript:
      properties:
        slug:
          type: string
          enum:
            - docker_cleanup
            - env_merge
          title: Slug
          description: Init script slug, as used in init_scripts
        selected:
          type: boolean
          title: Selected
          description: The CVM's current compose runs this script
        selectable:
          type: boolean
          title: Selectable
          description: >-
            The caller may select this script for this CVM's compose and OS
            image
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: Why the script is not selectable; null when it is
      type: object
      required:
        - slug
        - selected
        - selectable
      title: CvmInitScript
    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

````

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