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": "<string>",
      "priority": 123
    }
  ]
}
'
{
  "object": "list",
  "data": [
    {
      "id": "<string>",
      "resource_path": "<string>",
      "owner": "<string>",
      "workspace": "<string>",
      "name": "<string>",
      "object": "instance",
      "status": "awaiting_allocation",
      "capacity": {
        "id": "<string>",
        "name": "<string>"
      },
      "created_at": 1738972800,
      "image": {
        "id": "<string>",
        "name": "<string>"
      },
      "cloud_init_user_data_used": true,
      "priority": 123,
      "instance_sku": {
        "id": "<string>",
        "name": "<string>"
      },
      "deployment": {
        "id": "<string>",
        "name": "<string>"
      },
      "cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo=",
      "tags": {
        "env": "prod",
        "team": "infra"
      },
      "expected_shutdown_at": 1738972800
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.sfcompute.com/llms.txt

Use this file to discover all available pages before exploring further.

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).

Duplicate id entries are not deduplicated by serde; the handler runs the patches in order, so the last write 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