Skip to main content
PATCH
/
preview
/
v2
/
procurements
/
{id}
Update procurement
curl --request PATCH \
  --url https://api.sfcompute.com/preview/v2/procurements/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "my-resource-name",
  "instance_sku": "isku_k3R-nX9vLm7Qp2Yw5Jd8F",
  "min_sell_price_dollars_per_node_hour": "2.500000",
  "max_buy_price_dollars_per_node_hour": "2.500000",
  "managed_window_minutes": 64800,
  "enabled": true
}
'
import requests

url = "https://api.sfcompute.com/preview/v2/procurements/{id}"

payload = {
"name": "my-resource-name",
"instance_sku": "isku_k3R-nX9vLm7Qp2Yw5Jd8F",
"min_sell_price_dollars_per_node_hour": "2.500000",
"max_buy_price_dollars_per_node_hour": "2.500000",
"managed_window_minutes": 64800,
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'my-resource-name',
instance_sku: 'isku_k3R-nX9vLm7Qp2Yw5Jd8F',
min_sell_price_dollars_per_node_hour: '2.500000',
max_buy_price_dollars_per_node_hour: '2.500000',
managed_window_minutes: 64800,
enabled: true
})
};

fetch('https://api.sfcompute.com/preview/v2/procurements/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sfcompute.com/preview/v2/procurements/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'my-resource-name',
'instance_sku' => 'isku_k3R-nX9vLm7Qp2Yw5Jd8F',
'min_sell_price_dollars_per_node_hour' => '2.500000',
'max_buy_price_dollars_per_node_hour' => '2.500000',
'managed_window_minutes' => 64800,
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.sfcompute.com/preview/v2/procurements/{id}"

payload := strings.NewReader("{\n \"name\": \"my-resource-name\",\n \"instance_sku\": \"isku_k3R-nX9vLm7Qp2Yw5Jd8F\",\n \"min_sell_price_dollars_per_node_hour\": \"2.500000\",\n \"max_buy_price_dollars_per_node_hour\": \"2.500000\",\n \"managed_window_minutes\": 64800,\n \"enabled\": true\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.sfcompute.com/preview/v2/procurements/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-resource-name\",\n \"instance_sku\": \"isku_k3R-nX9vLm7Qp2Yw5Jd8F\",\n \"min_sell_price_dollars_per_node_hour\": \"2.500000\",\n \"max_buy_price_dollars_per_node_hour\": \"2.500000\",\n \"managed_window_minutes\": 64800,\n \"enabled\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sfcompute.com/preview/v2/procurements/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"my-resource-name\",\n \"instance_sku\": \"isku_k3R-nX9vLm7Qp2Yw5Jd8F\",\n \"min_sell_price_dollars_per_node_hour\": \"2.500000\",\n \"max_buy_price_dollars_per_node_hour\": \"2.500000\",\n \"managed_window_minutes\": 64800,\n \"enabled\": true\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "resource_path": "<string>",
  "owner": "<string>",
  "workspace": "<string>",
  "workspace_id": "<string>",
  "name": "<string>",
  "object": "procurement",
  "target": "node_count",
  "capacity": {
    "id": "cap_k3R-nX9vLm7Qp2Yw5Jd8F",
    "name": "<string>"
  },
  "pool": {
    "id": "<string>",
    "name": "<string>"
  },
  "instance_sku": {
    "object": "instance_sku",
    "id": "isku_k3R-nX9vLm7Qp2Yw5Jd8F",
    "alias": "<string>"
  },
  "min_sell_price_dollars_per_node_hour": "<string>",
  "max_buy_price_dollars_per_node_hour": "<string>",
  "managed_window_minutes": 64800,
  "enabled": true,
  "status": {
    "message": "<string>"
  },
  "created_at": 1738972800,
  "updated_at": 1738972800
}
{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}
{
"error": {
"type": "authentication_error",
"message": "<string>"
}
}
{
"error": {
"type": "forbidden",
"message": "<string>"
}
}
{
"error": {
"type": "not_found",
"message": "<string>"
}
}
{
"error": {
"type": "unprocessable_entity",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}
{
"error": {
"type": "api_error",
"message": "<string>"
}
}

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._-]+){2,2})
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"

instance_sku

Replace the procurement's instance SKU. Omit to leave unchanged.

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

"isku_k3R-nX9vLm7Qp2Yw5Jd8F"

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. The window contains this many complete minutes, beginning with the next minute. Buying power must cover each order's full duration.

Required range: 1 <= x <= 129600
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"

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

"wksp_k3R-nX9vLm7Qp2Yw5Jd8F"

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
object
required

Deprecated — use pool.

pool
object
required

A pool referenced by id and name.

instance_sku
object
required

Instance SKU this procurement's orders are pinned to. Carries the SKU's human-readable name when one is registered.

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. The window contains this many complete minutes, beginning with the next minute. Buying power must cover each order's full duration.

Required range: 1 <= x <= 129600
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