Fold one subject into another
curl --request POST \
--url https://api.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold \
--header 'x-api-key: <api-key>'import requests
url = "https://api.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold', 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.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"already": true,
"flattened": 123,
"from": {
"key": "<string>",
"kind": "<string>"
},
"into": {
"key": "<string>",
"kind": "<string>"
},
"mode": "<string>",
"merged_members": [
"<string>"
]
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}states
Fold one subject into another
Fold this subject’s record into the into subject under mode (an alias the reads
then resolve through). Refused on a self-fold, a cycle, or a merge that no longer validates.
POST
/
api
/
states
/
{name}
/
records
/
{target_kind}
/
{target_name}
/
{kind}
/
{key}
/
fold
Fold one subject into another
curl --request POST \
--url https://api.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold \
--header 'x-api-key: <api-key>'import requests
url = "https://api.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold', 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.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/fold")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"already": true,
"flattened": 123,
"from": {
"key": "<string>",
"kind": "<string>"
},
"into": {
"key": "<string>",
"kind": "<string>"
},
"mode": "<string>",
"merged_members": [
"<string>"
]
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Path Parameters
Response
Success.
The fold_state_record report: the fold mode, the from and into
subjects, whether the fold was already in place (a quiet no-op), and the number
of aliases flattened onto the survivor. merged_members — the survivor's
newly-filled top-level members — rides ONLY a merge fold; a switch omits it.
The Python attribute for the wire from key is suffixed (from is a keyword);
the wire key stays from via the alias.
Show child attributes
Show child attributes

