Skip to main content
PATCH
/
api
/
v1
/
cvms
/
{cvm_id}
Update CVM
curl --request PATCH \
  --url https://cloud-api.phala.com/api/v1/cvms/{cvm_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "docker_compose_file": "<string>",
  "pre_launch_script": "<string>",
  "allowed_envs": [
    "<string>"
  ],
  "public_logs": true,
  "public_sysinfo": true,
  "public_tcbinfo": true,
  "encrypted_env": "<string>",
  "user_config": "<string>",
  "gpus": {
    "gpus": [
      {
        "slot": "<string>",
        "product_id": "<string>"
      }
    ],
    "attach_mode": "listed"
  },
  "vcpu": 123,
  "memory": 123,
  "disk_size": 123,
  "image": "<string>",
  "shutdown_timeout": 605,
  "allow_force_stop": false
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Headers

X-Compose-Hash
string | null

Compose hash from Phase 1 response (Phase 2 only)

X-Transaction-Hash
string | null

Transaction hash proving on-chain registration (Phase 2 only)

X-Prepare-Only
string | null

When 'true', generate a commit token for multisig workflows instead of expecting immediate on-chain registration

Path Parameters

cvm_id
string
required

Body

application/json

PATCH request body — all fields optional, only set fields are applied.

docker_compose_file
string | null

Docker Compose YAML content

pre_launch_script
string | null

Shell script executed before containers start

allowed_envs
string[] | null

Allowed environment variable names (env_keys)

public_logs
boolean | null

Expose container logs publicly

public_sysinfo
boolean | null

Expose system info publicly

public_tcbinfo
boolean | null

Expose TCB attestation info publicly

encrypted_env
string | null

Encrypted environment variables as hex string

user_config
string | null

User configuration string

gpus
GpuConfig · object

GPU configuration

vcpu
integer | null

Number of vCPUs

memory
integer | null

Memory in MB

disk_size
integer | null

Disk size in MB

image
string | null

OS image name or slug from available-os-images

shutdown_timeout
integer | null

Timeout in seconds for graceful shutdown. null means no timeout.

Required range: 10 <= x <= 1200
allow_force_stop
boolean
default:false

When true, falls back to hard stop if graceful shutdown times out. Use for zombie CVMs that are unresponsive to shutdown signals.

Response

Update initiated, track via correlation_id