Create KPI HTTP sync draft
curl --request POST \
--url https://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"request_config": {
"method": "GET",
"url": "<string>",
"headers": {
"Accept": "application/json"
},
"jsonBody": null
},
"extraction_config": {
"contentType": "json",
"pointer": "<string>",
"numeric": {
"mode": "number"
}
},
"freshness_config": {}
}
'import requests
url = "https://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs"
payload = {
"name": "<string>",
"request_config": {
"method": "GET",
"url": "<string>",
"headers": { "Accept": "application/json" },
"jsonBody": None
},
"extraction_config": {
"contentType": "json",
"pointer": "<string>",
"numeric": { "mode": "number" }
},
"freshness_config": {}
}
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({
name: '<string>',
request_config: {
method: 'GET',
url: '<string>',
headers: {Accept: 'application/json'},
jsonBody: null
},
extraction_config: {contentType: 'json', pointer: '<string>', numeric: {mode: 'number'}},
freshness_config: {}
})
};
fetch('https://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs', 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://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs",
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([
'name' => '<string>',
'request_config' => [
'method' => 'GET',
'url' => '<string>',
'headers' => [
'Accept' => 'application/json'
],
'jsonBody' => null
],
'extraction_config' => [
'contentType' => 'json',
'pointer' => '<string>',
'numeric' => [
'mode' => 'number'
]
],
'freshness_config' => [
]
]),
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://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"request_config\": {\n \"method\": \"GET\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"jsonBody\": null\n },\n \"extraction_config\": {\n \"contentType\": \"json\",\n \"pointer\": \"<string>\",\n \"numeric\": {\n \"mode\": \"number\"\n }\n },\n \"freshness_config\": {}\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://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"request_config\": {\n \"method\": \"GET\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"jsonBody\": null\n },\n \"extraction_config\": {\n \"contentType\": \"json\",\n \"pointer\": \"<string>\",\n \"numeric\": {\n \"mode\": \"number\"\n }\n },\n \"freshness_config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs")
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 \"name\": \"<string>\",\n \"request_config\": {\n \"method\": \"GET\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"jsonBody\": null\n },\n \"extraction_config\": {\n \"contentType\": \"json\",\n \"pointer\": \"<string>\",\n \"numeric\": {\n \"mode\": \"number\"\n }\n },\n \"freshness_config\": {}\n}"
response = http.request(request)
puts response.read_body{}{
"sync": {
"id": "<string>",
"status": "draft",
"schedule": "hourly",
"config_hash": "<string>",
"config_version": 123
}
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}Strategy
Create KPI HTTP sync draft
Create a draft KPI HTTP sync for a readable KPI only. The destination host must already be exactly allowlisted. This never stores secret values, runs a network request, publishes, or writes snapshots.
POST
/
api
/
orgs
/
{id}
/
kpis
/
{kpiId}
/
http-syncs
Create KPI HTTP sync draft
curl --request POST \
--url https://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"request_config": {
"method": "GET",
"url": "<string>",
"headers": {
"Accept": "application/json"
},
"jsonBody": null
},
"extraction_config": {
"contentType": "json",
"pointer": "<string>",
"numeric": {
"mode": "number"
}
},
"freshness_config": {}
}
'import requests
url = "https://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs"
payload = {
"name": "<string>",
"request_config": {
"method": "GET",
"url": "<string>",
"headers": { "Accept": "application/json" },
"jsonBody": None
},
"extraction_config": {
"contentType": "json",
"pointer": "<string>",
"numeric": { "mode": "number" }
},
"freshness_config": {}
}
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({
name: '<string>',
request_config: {
method: 'GET',
url: '<string>',
headers: {Accept: 'application/json'},
jsonBody: null
},
extraction_config: {contentType: 'json', pointer: '<string>', numeric: {mode: 'number'}},
freshness_config: {}
})
};
fetch('https://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs', 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://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs",
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([
'name' => '<string>',
'request_config' => [
'method' => 'GET',
'url' => '<string>',
'headers' => [
'Accept' => 'application/json'
],
'jsonBody' => null
],
'extraction_config' => [
'contentType' => 'json',
'pointer' => '<string>',
'numeric' => [
'mode' => 'number'
]
],
'freshness_config' => [
]
]),
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://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"request_config\": {\n \"method\": \"GET\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"jsonBody\": null\n },\n \"extraction_config\": {\n \"contentType\": \"json\",\n \"pointer\": \"<string>\",\n \"numeric\": {\n \"mode\": \"number\"\n }\n },\n \"freshness_config\": {}\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://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"request_config\": {\n \"method\": \"GET\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"jsonBody\": null\n },\n \"extraction_config\": {\n \"contentType\": \"json\",\n \"pointer\": \"<string>\",\n \"numeric\": {\n \"mode\": \"number\"\n }\n },\n \"freshness_config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://atollhq.com/api/orgs/{id}/kpis/{kpiId}/http-syncs")
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 \"name\": \"<string>\",\n \"request_config\": {\n \"method\": \"GET\",\n \"url\": \"<string>\",\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"jsonBody\": null\n },\n \"extraction_config\": {\n \"contentType\": \"json\",\n \"pointer\": \"<string>\",\n \"numeric\": {\n \"mode\": \"number\"\n }\n },\n \"freshness_config\": {}\n}"
response = http.request(request)
puts response.read_body{}{
"sync": {
"id": "<string>",
"status": "draft",
"schedule": "hourly",
"config_hash": "<string>",
"config_version": 123
}
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Draft KPI HTTP sync config. Do not include secret values, query strings, request bodies, redirects, or third-party payloads.
GET/HTTPS/JSON-only sync draft. Destination host must already be exactly allowlisted. Do not include secret values, query strings, request bodies, redirects, or raw third-party payloads.
Response
Successful response
The response is of type object.
⌘I

