Adopt accepted accounts
curl --request POST \
--url https://{workspace}.klef.ai/api/adoption/runs/{runId}/plan \
--cookie klef.session=import requests
url = "https://{workspace}.klef.ai/api/adoption/runs/{runId}/plan"
headers = {"cookie": "klef.session="}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {cookie: 'klef.session='}};
fetch('https://{workspace}.klef.ai/api/adoption/runs/{runId}/plan', 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://{workspace}.klef.ai/api/adoption/runs/{runId}/plan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_COOKIE => "klef.session=",
]);
$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://{workspace}.klef.ai/api/adoption/runs/{runId}/plan"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("cookie", "klef.session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{workspace}.klef.ai/api/adoption/runs/{runId}/plan")
.header("cookie", "klef.session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://{workspace}.klef.ai/api/adoption/runs/{runId}/plan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'klef.session='
response = http.request(request)
puts response.read_body{
"result": {
"adopted": 123,
"failed": [
{
"workerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"error": {
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
}
]
},
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}Adoption
Adopt accepted accounts
Links each accepted account to its worker at once. One that could not be adopted, such as an account the connection no longer holds, is listed with the reason and the rest still are. Nothing is read from or written to the target, and a run is adopted once.
POST
/
adoption
/
runs
/
{runId}
/
plan
Adopt accepted accounts
curl --request POST \
--url https://{workspace}.klef.ai/api/adoption/runs/{runId}/plan \
--cookie klef.session=import requests
url = "https://{workspace}.klef.ai/api/adoption/runs/{runId}/plan"
headers = {"cookie": "klef.session="}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {cookie: 'klef.session='}};
fetch('https://{workspace}.klef.ai/api/adoption/runs/{runId}/plan', 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://{workspace}.klef.ai/api/adoption/runs/{runId}/plan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_COOKIE => "klef.session=",
]);
$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://{workspace}.klef.ai/api/adoption/runs/{runId}/plan"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("cookie", "klef.session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{workspace}.klef.ai/api/adoption/runs/{runId}/plan")
.header("cookie", "klef.session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://{workspace}.klef.ai/api/adoption/runs/{runId}/plan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'klef.session='
response = http.request(request)
puts response.read_body{
"result": {
"adopted": 123,
"failed": [
{
"workerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"error": {
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
}
]
},
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"code": "details_unavailable",
"params": {},
"causes": [
{
"code": "details_unavailable",
"params": {},
"causes": "<array>"
}
],
"target": "<string>"
}
]
}Authorizations
cookieAuthapiKeyAuth
Was this page helpful?