Skip to main content
PATCH
/
preview
/
v2
/
pools
/
{id}
Update pool
curl --request PATCH \
  --url https://api.sfcompute.com/preview/v2/pools/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "my-resource-name",
  "tags": {
    "env": "prod",
    "team": "infra"
  }
}
'
import requests

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

payload = {
"name": "my-resource-name",
"tags": {
"env": "prod",
"team": "infra"
}
}
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', tags: {env: 'prod', team: 'infra'}})
};

fetch('https://api.sfcompute.com/preview/v2/pools/{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/pools/{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',
'tags' => [
'env' => 'prod',
'team' => 'infra'
]
]),
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/pools/{id}"

payload := strings.NewReader("{\n \"name\": \"my-resource-name\",\n \"tags\": {\n \"env\": \"prod\",\n \"team\": \"infra\"\n }\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/pools/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-resource-name\",\n \"tags\": {\n \"env\": \"prod\",\n \"team\": \"infra\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sfcompute.com/preview/v2/pools/{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 \"tags\": {\n \"env\": \"prod\",\n \"team\": \"infra\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "resource_path": "<string>",
  "owner": "<string>",
  "workspace": "<string>",
  "workspace_id": "<string>",
  "name": "<string>",
  "object": "pool",
  "allocation_schedule": {
    "total": [
      {
        "start_at": 1738972800,
        "node_count": 123,
        "end_at": 1738972800
      }
    ],
    "by_instance_sku": {}
  },
  "created_at": 1738972800,
  "procurements": [
    {
      "id": "<string>",
      "name": "<string>"
    }
  ],
  "deployments": [
    {
      "id": "<string>",
      "name": "<string>"
    }
  ],
  "tags": {
    "env": "prod",
    "team": "infra"
  }
}
{
"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:pool:acme:prod:my-pool' 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: (pool_[0-9a-zA-Z_-]{1,21})|(sfc:pool:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){2,2})
Example:

"pool_k3R-nX9vLm7Qp2Yw5Jd8F"

Body

application/json

Update a pool. Omitted fields are left unchanged.

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

"my-resource-name"

tags
null | 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

Pool updated.

A pool — a container of owned compute allocation over time.

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

"pool_k3R-nX9vLm7Qp2Yw5Jd8F"

resource_path
string
required

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

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

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

kind
enum<string>
required

Pool kind determines what operations are allowed on a pool.

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

Discriminator for /pools responses.

Allowed value: "pool"
allocation_schedule
object
required

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

created_at
integer<int64>
required

Unix timestamp.

Example:

1738972800

procurements
object[]

Active procurements targeting this pool.

deployments
object[]

Active deployments targeting this pool.

tags
null | object

Metadata tags attached to this pool.

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