---
title: "Update instance"
method: PATCH
path: "/preview/v2/instances/{id}"
tags: ["Instances"]
---

# Update instance

`PATCH /preview/v2/instances/{id}`

> ⚠️ This endpoint is in [public preview](/preview/roadmap).

Update an instance. Omitted fields are left unchanged.

## Path parameters

- `id` string, required — 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.

## Request body

- SfcApiPatchInstanceRequest
  - `name` string
  - `tags` SfcApiTags
  - `priority` integer, nullable — Shutdown priority. Higher numbers are kept longer. Omit to leave unchanged.

## Response `200`

Instance updated.

- SfcApiInstanceResponse
  - `id` string, required
  - `resource_path` string, required — A resource path for a instance resource. Format: sfc:instance:<account>:<workspace>:<name>.
  - `owner` string, required
  - `workspace` string, required
  - `name` string, required
  - `object` 'instance', required
  - `status` 'awaiting_allocation' | 'running' | 'terminated' | 'failed', required — `awaiting_allocation` when waiting for compute allocation on its capacity, `running` once assigned and the physical machine is running (still takes time for the image to be downloaded and booted), `terminated` when stopped by the user or after running out of allocation, `failed` on hardware fault.
  - `instance_sku` SfcApiInstanceSkuSummary — Summary view of an instance SKU embedded on responses that reference one (orders, procurements, instances, capacity transfers). Carries both the id and the human-readable name. Legacy SKUs whose `name` column hasn't been backfilled use `UNKNOWN_INSTANCE_SKU_NAME` as a placeholder so this field is always populated on the wire.
    - `id` string, required
    - `name` string, required
  - `capacity` SfcApiCapacitySummary, required
    - `id` string, required
    - `name` string, required
  - `created_at` integer, required — Unix timestamp.
  - `image` SfcApiImageSummary, required
    - `id` string, required
    - `name` string, required
  - `deployment` SfcApiDeploymentSummary
    - `id` string, required
    - `name` string, required
  - `cloud_init_user_data_used` boolean, required — Whether cloud-init user data is configured for this instance.
  - `cloud_init_user_data` string, byte — Base64-encoded [cloud-init user data](https://cloudinit.readthedocs.io/en/latest/explanation/format/index.html).
  - `tags` SfcApiTags
  - `expected_shutdown_at` integer — Unix timestamp.
  - `priority` integer, required — Shutdown priority. Higher numbers are kept longer when the capacity's quota drops below the running-instance count. Default 0; any signed 64-bit integer is accepted.

## Other responses

- `400` — Validation error (e.g. duplicate name).
- `401` — Unauthorized.
- `403` — Forbidden.
- `404` — Instance not found.
- `500` — Internal server error.

---

[API](https://skmtc.net/sfcompute/apis/san-francisco-compute-documentation.md) · [All operations](https://skmtc.net/sfcompute/apis/san-francisco-compute-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sfcompute/san-francisco-compute-documentation/versions/93dd7661e9bb/schema)
