curl --request GET \
--url https://{workspace}.klef.ai/api/sync-plans \
--cookie klef.session=import requests
url = "https://{workspace}.klef.ai/api/sync-plans"
headers = {"cookie": "klef.session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'klef.session='}};
fetch('https://{workspace}.klef.ai/api/sync-plans', 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/sync-plans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/sync-plans"
req, _ := http.NewRequest("GET", 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.get("https://{workspace}.klef.ai/api/sync-plans")
.header("cookie", "klef.session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://{workspace}.klef.ai/api/sync-plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'klef.session='
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"kind": "policy",
"status": "generating",
"requestedByUserId": "<string>",
"requestedAt": "2023-11-07T05:31:56Z",
"generatedAt": "2023-11-07T05:31:56Z",
"approvedByUserId": "<string>",
"approvedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"errorMessage": "<string>",
"supersededBySyncPlanId": "<string>",
"isStale": true,
"unreadConnections": 123,
"policies": [
{
"id": "<string>",
"name": "<string>",
"version": 123,
"revision": 123,
"status": "active"
}
],
"stats": {
"operations": 123,
"affected": 123,
"undo": 123,
"blocked": 123,
"findings": 123,
"byKind": [
{
"kind": "create",
"count": 123
}
]
}
}
],
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
],
"pagination": {
"nextCursor": 123,
"limit": 123,
"hasMore": true,
"total": 123
}
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}List the workspace's sync plans.
curl --request GET \
--url https://{workspace}.klef.ai/api/sync-plans \
--cookie klef.session=import requests
url = "https://{workspace}.klef.ai/api/sync-plans"
headers = {"cookie": "klef.session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'klef.session='}};
fetch('https://{workspace}.klef.ai/api/sync-plans', 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/sync-plans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/sync-plans"
req, _ := http.NewRequest("GET", 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.get("https://{workspace}.klef.ai/api/sync-plans")
.header("cookie", "klef.session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://{workspace}.klef.ai/api/sync-plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'klef.session='
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"kind": "policy",
"status": "generating",
"requestedByUserId": "<string>",
"requestedAt": "2023-11-07T05:31:56Z",
"generatedAt": "2023-11-07T05:31:56Z",
"approvedByUserId": "<string>",
"approvedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"errorMessage": "<string>",
"supersededBySyncPlanId": "<string>",
"isStale": true,
"unreadConnections": 123,
"policies": [
{
"id": "<string>",
"name": "<string>",
"version": 123,
"revision": 123,
"status": "active"
}
],
"stats": {
"operations": 123,
"affected": 123,
"undo": 123,
"blocked": 123,
"findings": 123,
"byKind": [
{
"kind": "create",
"count": 123
}
]
}
}
],
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
],
"pagination": {
"nextCursor": 123,
"limit": 123,
"hasMore": true,
"total": 123
}
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}Authorizations
Cookie-based session. Obtain by completing the /auth/login/{provider} OAuth flow; the /auth/callback response sets the klef.session cookie that subsequent requests send automatically.
Query Parameters
Filter to plans in any of these lifecycle statuses.
Lifecycle state of a SyncPlan.
generating, ready, approved, executing, done, failed, done_with_errors, invalidated Filter to plans with an operation for this worker id.
Filter to plans of any of these kinds (default: policy).
What a SyncPlan was generated to do.
policy, adoption, reset Case-insensitive match on the name of any policy the plan evaluated.
3 - 100Order the results by this column (default: newest requested).
requested_at, status, generated_at, approved_at, completed_at, approved_by Sort direction for sort (default: descending).
asc, desc Filter to plans approved by any of these users.
Filter to plans requested by any of these users.
Include plans the schedule requested, alongside any requestedBy given.
Filter to plans completed at or after this instant.
Filter to plans completed at or before this instant.
Response
OK
The envelope for a collection response: IReadOnlyList<T> ApiCollectionResponse<T>.Results.
Was this page helpful?