---
title: "Upgrade pre-launch script to the latest official version"
method: POST
path: "/api/v1/cvms/{cvm_id}/pre-launch-script/upgrade-to-latest-official"
tags: ["CVMs"]
---

# Upgrade pre-launch script to the latest official version

`POST /api/v1/cvms/{cvm_id}/pre-launch-script/upgrade-to-latest-official`

## Request

- Base URL: `https://cloud-api.phala.com`
- URL: `https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/pre-launch-script/upgrade-to-latest-official`
- Auth: none declared
- TypeScript: <https://skmtc.dev/phala/apis/phala-cloud-api/docs/api/v1/cvms/:cvm_id/pre-launch-script/upgrade-to-latest-official/post.ts> (a function with typed inputs; its response is checked against the schema)

One-click upgrade that replaces the pre-launch script with the latest official version maintained by Phala and triggers the standard update workflow. Skips anti-fraud screening because the official script is trusted. For contract-owned KMS, the same two-phase verification flow as PATCH /pre-launch-script applies.

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

Upgrade initiated, track via correlation_id

- unknown

## Other responses

- `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

## 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/pre-launch-script/upgrade-to-latest-official/post.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)
