---
title: "Get CVM init scripts"
method: GET
path: "/api/v1/cvms/{cvm_id}/init-scripts"
tags: ["CVMs", "cvms-init-scripts"]
---

# Get CVM init scripts

`GET /api/v1/cvms/{cvm_id}/init-scripts`

## Request

- Base URL: `https://cloud-api.phala.com`
- URL: `https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/init-scripts`
- Auth: none declared
- TypeScript: <https://skmtc.dev/phala/apis/phala-cloud-api/docs/api/v1/cvms/:cvm_id/init-scripts/get.ts> (a function with typed inputs; its response is checked against the schema)

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.

## Path parameters

- `cvm_id` string, required

## Response `200`

Init scripts of the CVM

- CvmInitScriptsResponse
  - `items` CvmInitScript[], required: Every platform init script, in run order
    - `slug` 'docker_cleanup' | 'env_merge', required: Init script slug, as used in init_scripts
    - `selected` boolean, required: The CVM's current compose runs this script
    - `selectable` boolean, required: The caller may select this script for this CVM's compose and OS image
    - `reason` string, nullable: Why the script is not selectable; null when it is

## Other responses

- `401`: Not authenticated
- `404`: CVM not found, or its current compose is unavailable
- `422`: Validation Error

## Changes

- **2026-11-07** `c71a8dc90391`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/phala/apis/phala-cloud-api/changes/api/v1/cvms/:cvm_id/init-scripts/get.md)

---

[API](https://skmtc.dev/phala/apis/phala-cloud-api.md) - [All operations](https://skmtc.dev/phala/apis/phala-cloud-api/llms.txt) - [OpenAPI document](https://skmtc.dev/phala/apis/phala-cloud-api/revisions/c71a8dc90391?raw)
