Skip to main content
PATCH
/
v2
/
procurements
/
{id}
Update procurement
curl --request PATCH \
  --url https://api.sfcompute.com/v2/procurements/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "my-resource-name",
  "min_sell_price_dollars_per_node_hour": "2.500000",
  "max_buy_price_dollars_per_node_hour": "2.500000",
  "managed_window_minutes": 750,
  "enabled": true
}
'
{
  "id": "<string>",
  "resource_path": "<string>",
  "owner": "<string>",
  "workspace": "<string>",
  "name": "<string>",
  "object": "procurement",
  "target": "node_count",
  "capacity": "cap_k3R-nX9vLm7Qp2Yw5Jd8F",
  "min_sell_price_dollars_per_node_hour": "<string>",
  "max_buy_price_dollars_per_node_hour": "<string>",
  "managed_window_minutes": 750,
  "enabled": true,
  "status": {
    "state": "info",
    "message": "<string>"
  },
  "created_at": 1738972800,
  "updated_at": 1738972800
}

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:procurement:acme:prod:my-procurement' 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: (proc_[0-9a-zA-Z_-]{1,21})|(sfc:procurement:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,3})
Example:

"proc_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"

min_sell_price_dollars_per_node_hour
null | string

Minimum price to sell compute for ($/node-hour). Must contain decimal point. Will be rounded to nearest multiple of $0.000060.

Pattern: ^\d+\.\d+$
Example:

"2.500000"

max_buy_price_dollars_per_node_hour
null | string

Maximum price to buy compute ($/node-hour). Must contain decimal point. Will be rounded to nearest multiple of $0.000060.

Pattern: ^\d+\.\d+$
Example:

"2.500000"

managed_window_minutes
integer<int32> | null

How far ahead (in minutes) the procurement buys and sells compute. Higher values secure compute further in advance but commit to longer windows that may need to be sold when scaling down, potentially at a loss. Lower values reduce waste but risk compute being unavailable. Orders are placed in 1-hour blocks, so the furthest hour is secured up to managed_window_minutes - 60 minutes before it begins.

Required range: 60 <= x <= 1440
enabled
boolean | null

Response

Procurement updated.

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

"proc_k3R-nX9vLm7Qp2Yw5Jd8F"

resource_path
string
required

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

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

"sfc:procurement:<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"

object
string
default:procurement
required
read-only
Allowed value: "procurement"
target
default:node_count
required
Allowed value: "node_count"
capacity
required

ID (default) or expanded summary when using expand parameter

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

"cap_k3R-nX9vLm7Qp2Yw5Jd8F"

min_sell_price_dollars_per_node_hour
string
required

Minimum price to sell compute for ($/node-hour). Must contain decimal point. Will be rounded to nearest multiple of $0.000060.

Pattern: ^\d+\.\d+$
Example:

"2.500000"

max_buy_price_dollars_per_node_hour
string
required

Maximum price to buy compute ($/node-hour). Must contain decimal point. Will be rounded to nearest multiple of $0.000060.

Pattern: ^\d+\.\d+$
Example:

"2.500000"

managed_window_minutes
integer<int32>
required

How far ahead (in minutes) the procurement buys and sells compute. Higher values secure compute further in advance but commit to longer windows that may need to be sold when scaling down, potentially at a loss. Lower values reduce waste but risk compute being unavailable. Orders are placed in 1-hour blocks, so the furthest hour is secured up to managed_window_minutes - 60 minutes before it begins.

Required range: 60 <= x <= 1440
enabled
boolean
required

Enable/disable the procurement. Disabling cancels all standing orders.

status
object
required
created_at
integer<int64>
required

Unix timestamp.

Example:

1738972800

updated_at
integer<int64>
required

Unix timestamp.

Example:

1738972800