---
title: "Replace CVM annotations"
method: PUT
path: "/api/v1/cvms/{cvm_id}/annotations"
tags: ["CVMs", "cvms-annotations"]
---

# Replace CVM annotations

`PUT /api/v1/cvms/{cvm_id}/annotations`

## Request

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

Replaces every annotation of this CVM; an empty object clears them. The VMM applies the change at once, without a restart and without a compose change. Host tools that read annotations only when QEMU launches (for example memory tiers or vCPU pinning) see the new values after the CVM restarts. Other CVM updates never change annotations. Annotations are opaque key/value metadata for host-side tooling, such as a QEMU wrapper that reads the VM manifest. The dstack VMM stores them with the VM. They are not passed to the guest, not measured, and not part of the compose hash, so attestation does not cover them: tenants must not rely on them for security. Phala Cloud keeps no copy of annotations as CVM state: only the node's VMM holds them, and Cloud never copies or restores them. A replica starts without annotations; a relocated CVM keeps whatever its VMM manifest carries. A create request that carries annotations is recorded in the audit log. Requires the `cvm_annotations` feature flag (ERR-03-049) and dstack VMM 0.6.1 or newer on the node (ERR-03-050).

## Path parameters

- `cvm_id` string, required

## Request body

- UpdateCvmAnnotationsRequest: Full replacement of a CVM's annotations.
  - `annotations` object, required: Opaque key/value metadata for host-side tooling. The dstack VMM stores it with the VM; it is not passed to the guest, not measured, and not part of the compose hash, so it is host configuration that attestation does not cover. Do not rely on it for security. Replaces every annotation; an empty object clears them. Keys must not be empty.

## Response `200`

The annotations now stored

- CvmAnnotationsResponse: The annotations the node's VMM currently stores for one CVM.
  - `annotations` object, required: Opaque key/value metadata for host-side tooling. The dstack VMM stores it with the VM; it is not passed to the guest, not measured, and not part of the compose hash, so it is host configuration that attestation does not cover. Do not rely on it for security.

## Other responses

- `403`: ERR-03-049: the cvm_annotations feature flag is off
- `404`: CVM not found
- `409`: ERR-03-050: the node's dstack VMM is older than 0.6.1
- `422`: An empty key or a non-string value
- `502`: ERR-03-051: the node's VMM failed to read or write the annotations
- `503`: The node is offline or in maintenance

## 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/annotations/put.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)
