---
title: "Replicate CVM"
method: POST
path: "/api/v1/cvms/{cvm_id}/replicas"
tags: ["CVMs"]
---

# Replicate CVM

`POST /api/v1/cvms/{cvm_id}/replicas`

Create a replica of the CVM on a target node. If request body is omitted, it replicates to the source node and reuses existing env.

## Path parameters

- `cvm_id` string, required

## Headers

- `X-Prepare-Only` string, nullable

## Request body

- ReplicateRequest — Request model for CVM replication.
  - `teepod_id` integer, nullable — Target node ID (deprecated, use node_id)
  - `node_id` integer, nullable — Target node ID for the replica
  - `encrypted_env` string, nullable — New encrypted env blob (hex)
  - `compose_hash` string, nullable — Explicit compose hash to replicate. Required when the source app has multiple live instances.

## Response `200`

Replica CVM created

- unknown

## Other responses

- `400` — Invalid target node, image mismatch, or invalid encrypted_env
- `401` — Not authenticated
- `403` — CVM not in workspace
- `404` — CVM or target node not found
- `422` — Validation Error
- `465` — KMS allowlist rejection (contract-owned KMS)
- `500` — Replication failed

---

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