Skip to main content
POST
/
api
/
v1
/
apps
/
{app_id}
/
instances
Create a new instance under an existing app
curl --request POST \
  --url https://cloud-api.phala.com/api/v1/apps/{app_id}/instances \
  --header 'Content-Type: application/json' \
  --data '
{
  "teepod_id": 123,
  "node_id": 123,
  "encrypted_env": "<string>",
  "compose_hash": "<string>",
  "docker_compose_file": "<string>",
  "pre_launch_script": "<string>",
  "token": "<string>",
  "transaction_hash": "<string>"
}
'
{
  "id": 123,
  "name": "<string>",
  "status": "<string>",
  "teepod_id": 123,
  "app_id": "<string>",
  "vcpu": 123,
  "memory": 123,
  "disk_size": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "teepod": {
    "id": 123,
    "name": "<string>"
  },
  "user_id": 123,
  "vm_uuid": "<string>",
  "instance_id": "<string>",
  "app_url": "<string>",
  "base_image": "<string>",
  "manifest_version": 123,
  "version": "<string>",
  "runner": "<string>",
  "docker_compose_file": "<string>",
  "features": [
    "<string>"
  ],
  "encrypted_env_pubkey": "<string>"
}

Path Parameters

app_id
string
required

Hex app identifier

Body

application/json

Request model for creating a new instance under an existing app.

Inherits node_id, encrypted_env, compose_hash and their validators from ReplicateRequest.

teepod_id
integer | null

Target node ID (deprecated, use node_id)

node_id
integer | null

Target node ID for the replica

encrypted_env
string | null

New encrypted env blob (hex)

compose_hash
string | null

Explicit compose hash to replicate. Required when the source app has multiple live instances.

docker_compose_file
string | null

New Docker Compose YAML content

pre_launch_script
string | null

New pre-launch script content

token
string | null

Commit token returned by a prior prepare-only request. When set, this request commits the previously-prepared instance instead of preparing a new one.

transaction_hash
string | null

On-chain transaction hash proving compose-hash registration. Use 'already-registered' (or omit) when the hash was registered earlier.

Response

Instance created

id
integer
required
name
string
required
status
string
required
teepod_id
integer
required
app_id
string
required
vcpu
integer
required
memory
integer
required
disk_size
integer
required
created_at
string<date-time>
required
teepod
TeepodMeta · object
user_id
integer | null
vm_uuid
string | null
instance_id
string | null
app_url
string | null
base_image
string | null
manifest_version
integer | null
version
string | null
runner
string | null
docker_compose_file
string | null
features
string[] | null
encrypted_env_pubkey
string | null