---
title: "Trigger compose file update"
method: PATCH
path: "/api/v1/cvms/{cvm_id}/compose_file"
tags: ["CVMs"]
---

# Trigger compose file update

`PATCH /api/v1/cvms/{cvm_id}/compose_file`

Applies a provisioned compose file update. Requires compose_hash from provision endpoint. Restarts the CVM with new configuration.

## Path parameters

- `cvm_id` string, required

## Request body

- BodyTriggerCvmComposeFileUpdateApiV1CvmsCvmIdComposeFilePatch
  - `compose_hash` string, required — Hash from provision response
  - `encrypted_env` string, nullable — New encrypted env blob (hex)
  - `env_keys` string[], nullable — Allowed env var names
  - `update_env_vars` boolean, nullable — Update allowed_envs list

## Response `202`

Update initiated

- unknown

## Other responses

- `400` — Provision not found or invalid CVM
- `401` — Authentication required
- `403` — CVM not in workspace
- `404` — CVM not found
- `422` — Validation Error
- `503` — Node under maintenance

---

[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)
