Skip to main content
PATCH
/
v2
/
capacities
/
{id}
Update capacity
curl --request PATCH \
  --url https://api.sfcompute.com/v2/capacities/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "my-resource-name",
  "zones": [
    "richmond"
  ],
  "tags": {
    "env": "prod",
    "team": "infra"
  }
}
'
{
  "id": "<string>",
  "resource_path": "<string>",
  "owner": "<string>",
  "workspace": "<string>",
  "name": "<string>",
  "kind": "market",
  "object": "capacity",
  "zones": [
    "richmond"
  ],
  "allocation_schedule": {
    "total": [
      {
        "effective_at": 1738972800,
        "node_allocation": 123
      }
    ],
    "by_zone": {}
  },
  "created_at": 1738972800,
  "procurements": [
    "<string>"
  ],
  "deployments": [
    "<string>"
  ],
  "tags": {
    "env": "prod",
    "team": "infra"
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

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

Pattern: (cap_[0-9a-zA-Z_-]{1,21})|(sfc:capacity:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,3})
Example:

"cap_k3R-nX9vLm7Qp2Yw5Jd8F"

Body

application/json
name
null | string
Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

zones
string[] | null

Datacenter locations orders into this capacity can acquire compute from. Replaces existing zones. Does not affect already scheduled compute.

Minimum array length: 1
tags
object

Metadata tags. Full replacement semantics: replaces all existing tags. Omit to leave tags unchanged. Set to null to clear all tags.

Example:
{ "env": "prod", "team": "infra" }

Response

Capacity updated.

id
string
required
Pattern: cap_[0-9a-zA-Z_-]{1,21}
Example:

"cap_k3R-nX9vLm7Qp2Yw5Jd8F"

resource_path
string
required

A resource path for a capacity resource. Format: sfc:capacity:::.

Pattern: sfc:capacity:([a-zA-Z0-9._-]+:){2}[a-zA-Z0-9._-]+
Example:

"sfc:capacity:<account_id>:<workspace>:<name>"

owner
string
required
Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

workspace
string
required
Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

name
string
required
Required string length: 1 - 255
Pattern: [a-zA-Z0-9][a-zA-Z0-9._-]{0,254}
Example:

"my-resource-name"

kind
enum<string>
required

Capacity kind determines what operations are allowed on a capacity.

  • Market: User-created capacities. - Originating: Provider capacities for selling compute. Cannot add compute (buy orders/procurements). - ReadOnly: System-managed capacities used for legacy compute, bare metal contracts, and other. Cannot be modified through the API.
Available options:
market,
originating,
read_only
object
string
default:capacity
required
read-only
Allowed value: "capacity"
zones
string[]
required

Datacenter locations orders into this capacity can acquire compute from.

Minimum array length: 1
allocation_schedule
object
required

Allocation schedule of this capacity. Add to the schedule by placing buy orders into this capacity.

created_at
integer<int64>
required

Unix timestamp.

Example:

1738972800

procurements

Active procurements targeting this capacity. Returns IDs by default, or summaries when expand=procurements is set.

Pattern: proc_[0-9a-zA-Z_-]{1,21}
deployments

Active deployments targeting this capacity. Returns IDs by default, or summaries when expand=deployments is set.

Pattern: depl_[0-9a-zA-Z_-]{1,21}
tags
object

Metadata tags attached to this capacity.

Example:
{ "env": "prod", "team": "infra" }