v1

latestOpenAPI 3.1.02026-07-2665179189.7 KB
Instance Templates

Create instance template

⚠️ This endpoint is in public preview.

Create a reusable instance template.

post/preview/v2/instance_templates

Request body

namestring
workspacestring required

A resource path like 'sfc:workspace:acme:my-workspace' or an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.

imagestring required

A resource path like 'sfc:image:acme:prod:my-image' or an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.

tagsTags
cloud_init_user_datastring byte

Base64-encoded cloud-init user data. Maximum 64KB.

Example request

{
  "name": "my-resource-name",
  "workspace": "wksp_k3R-nX9vLm7Qp2Yw5Jd8F",
  "image": "image_k3R-nX9vLm7Qp2Yw5Jd8F",
  "tags": {
    "env": "prod",
    "team": "infra"
  },
  "cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo="
}

Response

Instance template created.

resource_pathstring required

A resource path for a instance_template resource. Format: sfc:instance_template:<account>:<workspace>:<name>.

ownerstring required
workspacestring required
workspace_idstring required
namestring required
object'instance_template' required
cloud_init_user_data_usedboolean required

Whether cloud-init user data is configured for this template.

tagsTags
created_atinteger required

Unix timestamp.

cloud_init_user_datastring byte

Base64-encoded cloud-init user data.

Example response

{
  "id": "itmpl_k3R-nX9vLm7Qp2Yw5Jd8F",
  "resource_path": "sfc:instance_template:<account_id>:<workspace>:<name>",
  "owner": "my-resource-name",
  "workspace": "my-resource-name",
  "workspace_id": "wksp_k3R-nX9vLm7Qp2Yw5Jd8F",
  "name": "my-resource-name",
  "image": {
    "id": "image_k3R-nX9vLm7Qp2Yw5Jd8F",
    "name": "my-resource-name"
  },
  "tags": {
    "env": "prod",
    "team": "infra"
  },
  "created_at": 1738972800,
  "cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo="
}