Skip to main content
PATCH
/
preview
/
v2
/
instances
Update multiple instances
curl --request PATCH \
  --url https://api.sfcompute.com/preview/v2/instances \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "data": [
    {
      "id": "inst_k3R-nX9vLm7Qp2Yw5Jd8F"
    }
  ]
}
'
{
  "object": "list",
  "data": [
    {
      "id": "inst_k3R-nX9vLm7Qp2Yw5Jd8F",
      "resource_path": "<string>",
      "owner": "<string>",
      "workspace": "<string>",
      "workspace_id": "<string>",
      "name": "<string>",
      "object": "instance",
      "capacity": {
        "id": "cap_k3R-nX9vLm7Qp2Yw5Jd8F",
        "name": "<string>"
      },
      "pool": {
        "id": "<string>",
        "name": "<string>"
      },
      "created_at": 1738972800,
      "image": {
        "id": "image_k3R-nX9vLm7Qp2Yw5Jd8F",
        "name": "<string>"
      },
      "cloud_init_user_data_used": true,
      "instance_sku": {
        "object": "instance_sku",
        "id": "isku_k3R-nX9vLm7Qp2Yw5Jd8F",
        "alias": "<string>"
      },
      "deployment": {
        "id": "<string>",
        "name": "<string>"
      },
      "cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo=",
      "tags": {
        "env": "prod",
        "team": "infra"
      },
      "expected_shutdown_at": 1738972800
    }
  ]
}

Authorizations

Authorization
string
header
required

Create an API token using sf tokens create or at https://sfcompute.com/account/api-keys.

Body

application/json

Request body for PATCH /v2/instances (batch). Each entry in data applies a partial patch to one instance; instances not mentioned are untouched. All entries must succeed or none — a single failure rolls back every other entry's writes (422).

When the same id appears more than once in data, the last occurrence wins.

data
object[]
required

Response

Instances updated.

Response shape for PATCH /v2/instances (batch). Mirrors the input list — one InstanceResponse per unique id in the request body, reflecting the post-write state. Unlike the paginated list response, there's no cursor or has_more: the response is exactly the instances the caller mentioned, no pagination involved.

object
string
default:list
required
read-only
Allowed value: "list"
data
object[]
required