patchCvm sends any set of changes in one request to PATCH /cvms/{cvmId}. updateCvmResources and updateCvmVisibility send a subset of fields to the same endpoint. The other updateXxxx methods call their own endpoints. See Update CVM Configuration for what each field does and which settings cannot change after create.
updateCvmResources
PATCH /cvms/{cvmId}
Updates CVM compute resources (vCPU, memory, disk, instance type). It sends only these four fields.
Parameters:
Returns:
{ message, correlation_id, status }. correlation_id tracks the update.
Example:
updateCvmVisibility
PATCH /cvms/{cvmId}
Sets what the public can see about the CVM: system info, logs and TCB info.
Parameters:
Returns:
{ message, correlation_id, status }. status is "in_progress", or "no_change" with an empty correlation_id when the settings already match.
These settings are part of the compose hash. For a CVM on Onchain KMS, the request fails with HTTP 465 until the new hash is registered on-chain. Register it and call again, or use patchCvm, which returns the hash to register and supports prepareOnly.
The Trust Center listing is not a visibility setting. Change it with PATCH /cvms/{cvmId}/listed.
updatePreLaunchScript
PATCH /cvms/{cvmId}/pre-launch-script
Updates the pre-launch script for a CVM.
Parameters:
Returns: Union type:
{ status: "in_progress", message, correlation_id }— update accepted{ status: "precondition_required", message, compose_hash, app_id, device_id, kms_info }— on-chain KMS requires compose hash registration first
For CVMs using on-chain KMS, this function may return
precondition_required. You must register the compose_hash on-chain using addComposeHash before retrying with the compose_hash and transaction_hash parameters.updateOsImage
PATCH /cvms/{cvmId}/os-image
Updates the OS image for a CVM. The CVM will restart with the new image.
Parameters:
Returns:
undefined. The API answers 202 with { message, correlation_id, status }, but updateOsImage discards it.
getAvailableOsImages
GET /os-images
Returns the list of available OS images.
Parameters: None (optional filters).
Returns: GetAvailableOSImagesResponse — array of OS image variants with version info.
Example:
refreshCvmInstanceId
POST /cvms/{cvmId}/refresh-instance-id
Generates a new instance ID for a CVM. This invalidates the old instance ID.
Parameters:
Returns:
InstanceIdRefreshResult with the new instance_id.
refreshCvmInstanceIds
POST /cvms/refresh-instance-ids
Generates new instance IDs for multiple CVMs in a single request.
Parameters:
Returns:
RefreshCvmInstanceIdsResponse — batch results.
provisionCvmComposeFileUpdate
POST /cvms/{cvmId}/compose_file/provision
Provisions a compose file update — the first phase of a two-phase compose file change. Returns a compose_hash needed for the commit step.
Parameters:
Returns:
ProvisionCvmComposeFileUpdateResult
Example:
commitCvmComposeFileUpdate
POST /cvms/{cvmId}/compose_file/commit
Commits a compose file update — the second phase. For on-chain KMS, the compose_hash must be registered on-chain before calling this.
Parameters:
Returns:
CommitCvmComposeFileUpdate — update details.
patchCvm
PATCH /cvms/{cvmId}
Applies partial updates to a CVM via the unified PATCH endpoint. Only fields present in the request body are applied. You can update compose files, environment variables, resources, visibility, and OS images all in a single call.
compose is a JSON Merge Patch of the app compose: a key you set changes that value, null removes the key, and a key you leave out stays as it is. See How does the compose patch work? for the keys and the settings that cannot change after create.
For CVMs with on-chain KMS (ETHEREUM/BASE), a change to the compose needs a second step only when the new compose hash is not on the app contract yet. The API then answers HTTP 465, and patchCvm returns { requiresOnChainHash: true, composeHash, ... } with the hash to register. After registration, call confirmCvmPatch with the transaction proof. If the hash is already allowed, or the patch does not change the compose (for example a resize), the update starts at once and you get correlationId. prepareOnly is not a dry run: an update that needs no registration starts right away.
Parameters:
Returns: Discriminated union on
requiresOnChainHash:
Accepted (requiresOnChainHash: false):
Hash required (
requiresOnChainHash: true):
Example — simple update (PHALA KMS):
getCvmInitScripts
GET /cvms/{cvmId}/init-scripts
Lists the platform init scripts, in run order, and for each one whether the CVM runs it (selected), whether you can pick it for this CVM (selectable) and, if not, why (reason). Change the selection with patchCvm’s init_scripts. See Init scripts.
Parameters: id (CVM identifier).
Returns: { items: [{ slug, selected, selectable, reason }] }
getCvmAnnotations / updateCvmAnnotations
GET /cvms/{cvmId}/annotations / PUT /cvms/{cvmId}/annotations
Reads or replaces the CVM’s annotations: key/value settings for tools on the host. They are not measured and attestation does not cover them. updateCvmAnnotations replaces every annotation, and {} clears them. It does not restart the CVM. Annotations sit behind a feature flag; without it, both calls fail with ERR-03-049. See Annotations.
Parameters: id (CVM identifier), plus annotations (Record<string, string>) for updateCvmAnnotations.
Returns: { annotations }, the annotations the node now stores.
confirmCvmPatch
PATCH /cvms/{cvmId} (with X-Compose-Hash and X-Transaction-Hash headers)
Completes the second phase of an on-chain KMS CVM update. Call this after patchCvm returns { requiresOnChainHash: true } and you have registered the compose hash on-chain via addComposeHash.
Parameters:
Returns:
ConfirmCvmPatchResult
Example:
commitCvmUpdate
POST /cvms/{cvmId}/commit-update
Completes a two-phase CVM update using a one-time commit token. This enables multisig workflows where the on-chain signer is different from the original API caller. The token is generated when you call patchCvm with prepareOnly: true.
Parameters:
Returns:
CommitCvmUpdateResult
Example:

