---
title: "Update pre-launch script"
method: PATCH
path: "/api/v1/cvms/{cvm_id}/pre-launch-script"
tags: ["CVMs"]
---

# Update pre-launch script

`PATCH /api/v1/cvms/{cvm_id}/pre-launch-script`

Replaces the pre-launch script and restarts the CVM. For contract-owned KMS, requires two-phase flow with on-chain hash registration.

## Path parameters

- `cvm_id` string, required

## Headers

- `X-Compose-Hash` string, nullable — Compose hash from Phase 1 response
- `X-Transaction-Hash` string, nullable — Transaction hash proving on-chain registration

## Response `202`

Update initiated, track via correlation_id

- unknown

## Other responses

- `400` — Invalid content type or empty body
- `401` — Authentication required
- `403` — CVM not in workspace
- `404` — CVM not found
- `409` — Another operation in progress
- `422` — Validation Error
- `465` — Compose hash registration required (Phase 1)
- `466` — Compose hash invalid or expired
- `467` — Transaction verification failed
- `468` — Compose hash not allowed on-chain
- `500` — KMS configuration or RPC error

---

[API](https://skmtc.net/phala/apis/phala-cloud-api.md) · [All operations](https://skmtc.net/phala/apis/phala-cloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/phala/phala-cloud-api/versions/83c6ae62e860/schema)
