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"
}
}Update a capacity. Omitted fields are left unchanged.
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"
}
}Create an API token using sf tokens create or at https://sfcompute.com/account/api-keys.
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.
(cap_[0-9a-zA-Z_-]{1,21})|(sfc:capacity:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,3})"cap_k3R-nX9vLm7Qp2Yw5Jd8F"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
Datacenter locations orders into this capacity can acquire compute from. Replaces existing zones. Does not affect already scheduled compute.
1Metadata tags. Full replacement semantics: replaces all existing tags. Omit to leave tags unchanged. Set to null to clear all tags.
Show child attributes
{ "env": "prod", "team": "infra" }Capacity updated.
cap_[0-9a-zA-Z_-]{1,21}"cap_k3R-nX9vLm7Qp2Yw5Jd8F"
A resource path for a capacity resource. Format: sfc:capacity:
sfc:capacity:([a-zA-Z0-9._-]+:){2}[a-zA-Z0-9._-]+"sfc:capacity:<account_id>:<workspace>:<name>"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
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.market, originating, read_only "capacity"Datacenter locations orders into this capacity can acquire compute from.
1Allocation schedule of this capacity. Add to the schedule by placing buy orders into this capacity.
Show child attributes
Unix timestamp.
1738972800
Active procurements targeting this capacity. Returns IDs by default, or summaries when expand=procurements is set.
proc_[0-9a-zA-Z_-]{1,21}Active deployments targeting this capacity. Returns IDs by default, or summaries when expand=deployments is set.
depl_[0-9a-zA-Z_-]{1,21}Metadata tags attached to this capacity.
Show child attributes
{ "env": "prod", "team": "infra" }