Add Root
Add a root to a connector source (Notion page id, a URL, an S3 key, or a Drive file).
POST
/
v1
/
knowledge-base
/
knowledge-bases
/
{kb_id}
/
sources
/
{source_id}
/
roots
Add Root
curl --request POST \
--url https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"provider_item_id": "<string>",
"url": "<string>",
"s3_path": "<string>",
"resource_key": "<string>",
"shortcut_target_resource_key": "<string>"
}
'import requests
url = "https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots"
payload = {
"provider_item_id": "<string>",
"url": "<string>",
"s3_path": "<string>",
"resource_key": "<string>",
"shortcut_target_resource_key": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider_item_id: '<string>',
url: '<string>',
s3_path: '<string>',
resource_key: '<string>',
shortcut_target_resource_key: '<string>'
})
};
fetch('https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots', 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-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots",
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([
'provider_item_id' => '<string>',
'url' => '<string>',
's3_path' => '<string>',
'resource_key' => '<string>',
'shortcut_target_resource_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots"
payload := strings.NewReader("{\n \"provider_item_id\": \"<string>\",\n \"url\": \"<string>\",\n \"s3_path\": \"<string>\",\n \"resource_key\": \"<string>\",\n \"shortcut_target_resource_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider_item_id\": \"<string>\",\n \"url\": \"<string>\",\n \"s3_path\": \"<string>\",\n \"resource_key\": \"<string>\",\n \"shortcut_target_resource_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider_item_id\": \"<string>\",\n \"url\": \"<string>\",\n \"s3_path\": \"<string>\",\n \"resource_key\": \"<string>\",\n \"shortcut_target_resource_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"knowledge_base_source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_item_id": "<string>",
"item_type": "<string>",
"display_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"source_url": "<string>",
"is_recursive": false,
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Response
Successful Response
Maximum string length:
255Maximum string length:
50Maximum string length:
500Maximum string length:
1000Was this page helpful?
⌘I
Add Root
curl --request POST \
--url https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"provider_item_id": "<string>",
"url": "<string>",
"s3_path": "<string>",
"resource_key": "<string>",
"shortcut_target_resource_key": "<string>"
}
'import requests
url = "https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots"
payload = {
"provider_item_id": "<string>",
"url": "<string>",
"s3_path": "<string>",
"resource_key": "<string>",
"shortcut_target_resource_key": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider_item_id: '<string>',
url: '<string>',
s3_path: '<string>',
resource_key: '<string>',
shortcut_target_resource_key: '<string>'
})
};
fetch('https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots', 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-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots",
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([
'provider_item_id' => '<string>',
'url' => '<string>',
's3_path' => '<string>',
'resource_key' => '<string>',
'shortcut_target_resource_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots"
payload := strings.NewReader("{\n \"provider_item_id\": \"<string>\",\n \"url\": \"<string>\",\n \"s3_path\": \"<string>\",\n \"resource_key\": \"<string>\",\n \"shortcut_target_resource_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider_item_id\": \"<string>\",\n \"url\": \"<string>\",\n \"s3_path\": \"<string>\",\n \"resource_key\": \"<string>\",\n \"shortcut_target_resource_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.featherhq.com/v1/knowledge-base/knowledge-bases/{kb_id}/sources/{source_id}/roots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider_item_id\": \"<string>\",\n \"url\": \"<string>\",\n \"s3_path\": \"<string>\",\n \"resource_key\": \"<string>\",\n \"shortcut_target_resource_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"knowledge_base_source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_item_id": "<string>",
"item_type": "<string>",
"display_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"source_url": "<string>",
"is_recursive": false,
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}