Skip to main content
PATCH
/
api
/
v1
/
cvms
/
{cvm_id}
/
envs
Update environment variables
curl --request PATCH \
  --url https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/envs \
  --header 'Content-Type: application/json' \
  --data '
{
  "encrypted_env": "<string>",
  "env_keys": [
    "<string>"
  ],
  "compose_hash": "<string>",
  "transaction_hash": "<string>"
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Path Parameters

cvm_id
string
required

Body

application/json
encrypted_env
string
required

Encrypted env blob as hex string

env_keys
string[] | null

Allowed env var names. Changes trigger verification for contract-owned KMS.

compose_hash
string | null

Hash from Phase 1 response (Phase 2 only)

transaction_hash
string | null

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

Response

Update initiated, returns correlation_id and allowed_envs_changed flag