v1
latestOpenAPI 3.1.02026-07-2665179189.7 KBReplace instance
⚠️ This endpoint is in public preview.
Terminates the target instance and creates a fresh one on the same capacity and SKU with a new image (and optionally a new startup script and name). Capacity, SKU, subnet, public IPv4, firewall, tags, and priority are inherited from the replaced instance. The two operations happen in a single transaction. Pass an Idempotency-Key header to make retries safe: a repeated request returns the replacement created by the first attempt instead of creating another one.
Path parameters
A resource path like 'sfc:instance:acme:prod:my-instance' or an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
Headers
Optional key that makes the request idempotent. Retries with the same key return the original replacement.
Request body
Example request
{
"image": "image_k3R-nX9vLm7Qp2Yw5Jd8F",
"cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo=",
"name": "my-resource-name"
}Response
Replacement instance created.
Example response
{
"id": "inst_k3R-nX9vLm7Qp2Yw5Jd8F",
"resource_path": "sfc:instance:<account_id>:<workspace>:<name>",
"owner": "my-resource-name",
"workspace": "my-resource-name",
"workspace_id": "wksp_k3R-nX9vLm7Qp2Yw5Jd8F",
"name": "my-resource-name",
"instance_sku": {
"id": "isku_k3R-nX9vLm7Qp2Yw5Jd8F",
"alias": "my-resource-name"
},
"capacity": {
"id": "cap_k3R-nX9vLm7Qp2Yw5Jd8F",
"name": "my-resource-name"
},
"pool": {
"id": "pool_k3R-nX9vLm7Qp2Yw5Jd8F",
"name": "my-resource-name"
},
"created_at": 1738972800,
"updated_at": 1738972800,
"image": {
"id": "image_k3R-nX9vLm7Qp2Yw5Jd8F",
"name": "my-resource-name"
},
"managed_by": {
"id": "depl_k3R-nX9vLm7Qp2Yw5Jd8F",
"name": "my-resource-name"
},
"cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo=",
"firewall": "frwl_k3R-nX9vLm7Qp2Yw5Jd8F",
"tags": {
"env": "prod",
"team": "infra"
},
"expected_shutdown_at": 1738972800
}