Skip to main content
POST
/
preview
/
v2
/
pool_transfers
Create pool transfer
curl --request POST \
  --url https://api.sfcompute.com/preview/v2/pool_transfers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "from_pool": "<string>",
  "to_pool": "<string>",
  "allocation_schedule_delta": [
    {
      "start_at": 1738972800,
      "node_count": 123,
      "end_at": 1738972800
    }
  ],
  "instance_sku": "isku_k3R-nX9vLm7Qp2Yw5Jd8F"
}
'
import requests

url = "https://api.sfcompute.com/preview/v2/pool_transfers"

payload = {
"from_pool": "<string>",
"to_pool": "<string>",
"allocation_schedule_delta": [
{
"start_at": 1738972800,
"node_count": 123,
"end_at": 1738972800
}
],
"instance_sku": "isku_k3R-nX9vLm7Qp2Yw5Jd8F"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from_pool: '<string>',
to_pool: '<string>',
allocation_schedule_delta: [{start_at: 1738972800, node_count: 123, end_at: 1738972800}],
instance_sku: 'isku_k3R-nX9vLm7Qp2Yw5Jd8F'
})
};

fetch('https://api.sfcompute.com/preview/v2/pool_transfers', 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/pool_transfers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from_pool' => '<string>',
'to_pool' => '<string>',
'allocation_schedule_delta' => [
[
'start_at' => 1738972800,
'node_count' => 123,
'end_at' => 1738972800
]
],
'instance_sku' => 'isku_k3R-nX9vLm7Qp2Yw5Jd8F'
]),
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/pool_transfers"

payload := strings.NewReader("{\n \"from_pool\": \"<string>\",\n \"to_pool\": \"<string>\",\n \"allocation_schedule_delta\": [\n {\n \"start_at\": 1738972800,\n \"node_count\": 123,\n \"end_at\": 1738972800\n }\n ],\n \"instance_sku\": \"isku_k3R-nX9vLm7Qp2Yw5Jd8F\"\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.sfcompute.com/preview/v2/pool_transfers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_pool\": \"<string>\",\n \"to_pool\": \"<string>\",\n \"allocation_schedule_delta\": [\n {\n \"start_at\": 1738972800,\n \"node_count\": 123,\n \"end_at\": 1738972800\n }\n ],\n \"instance_sku\": \"isku_k3R-nX9vLm7Qp2Yw5Jd8F\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sfcompute.com/preview/v2/pool_transfers")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_pool\": \"<string>\",\n \"to_pool\": \"<string>\",\n \"allocation_schedule_delta\": [\n {\n \"start_at\": 1738972800,\n \"node_count\": 123,\n \"end_at\": 1738972800\n }\n ],\n \"instance_sku\": \"isku_k3R-nX9vLm7Qp2Yw5Jd8F\"\n}"

response = http.request(request)
puts response.read_body
{
  "object": "pool_transfer",
  "id": "pxfr_k3R-nX9vLm7Qp2Yw5Jd8F",
  "created_at": 1738972800,
  "from_pool": "<string>",
  "to_pool": "<string>",
  "instance_sku": {
    "object": "instance_sku",
    "id": "isku_k3R-nX9vLm7Qp2Yw5Jd8F",
    "alias": "<string>"
  },
  "allocation_schedule_delta": [
    {
      "start_at": 1738972800,
      "node_count": 123,
      "end_at": 1738972800
    }
  ],
  "rejected_reason": "<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>"
}
}
{
"error": {
"type": "service_unavailable",
"message": "<string>"
}
}

Authorizations

Authorization
string
header
required

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

Headers

Idempotency-Key
string | null

Unique key for idempotent transfer creation.

Body

application/json

Transfer some or all of one pool into another.

from_pool
string
required

Source pool (must belong to the authenticated caller).

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

"pool_k3R-nX9vLm7Qp2Yw5Jd8F"

to_pool
string
required

Destination pool (must belong to the authenticated caller).

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

"pool_k3R-nX9vLm7Qp2Yw5Jd8F"

allocation_schedule_delta
object[]
required

The transfer's allocation schedule as constant-quantity rectangles. If the final entry does not have end_at: null, a zero-quantity unbounded tail is appended automatically.

instance_sku
required

Instance SKU the transfer applies to.

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

"isku_k3R-nX9vLm7Qp2Yw5Jd8F"

Response

Pool transfer accepted.

A transfer of compute from one pool (from_pool) to another (to_pool).

object
string
default:pool_transfer
required
read-only

Discriminator for /pool_transfers responses.

Allowed value: "pool_transfer"
id
required

Accepts the canonical prefix below; additional legacy prefixes are aliased for read compatibility. Writes always emit the canonical form.

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

"pxfr_k3R-nX9vLm7Qp2Yw5Jd8F"

status
enum<string>
required

Lifecycle status of a pool transfer.

Available options:
pending,
executed,
rejected
created_at
integer<int64>
required

Unix timestamp.

Example:

1738972800

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

"pool_k3R-nX9vLm7Qp2Yw5Jd8F"

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

"pool_k3R-nX9vLm7Qp2Yw5Jd8F"

instance_sku
object
required

Instance SKU the transfer applied to. Carries the SKU's human-readable name when one is registered.

allocation_schedule_delta
object[]
required

The transfer's allocation schedule, expanded into constant-quantity rectangles. The final rectangle has end_at: null (the unbounded tail); gaps are represented as explicit zero-quantity rectangles.

rejected_reason
string | null

Reason a pool transfer was rejected.