List webhook sources
curl --request GET \
--url https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks', 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.naturalead.ai/api/knowledge-bases/{id}/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.naturalead.ai/api/knowledge-bases/{id}/webhooks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"_id": "<string>",
"accountId": "<string>",
"knowledgeBaseId": "<string>",
"name": "<string>",
"enabled": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"steps": [
{
"name": "<string>",
"order": 123,
"url": "<string>",
"method": "GET",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"extractions": [
{
"variableName": "<string>",
"jsonPath": "<string>",
"useAsContext": false
}
],
"fanOut": {
"sourcePath": "<string>",
"itemVariable": "item",
"rateLimit": {
"delayMs": 123
}
},
"retry": {
"maxAttempts": 0,
"initialDelayMs": 1000,
"maxDelayMs": 30000,
"backoffMultiplier": 2
},
"onError": "fail",
"timeoutMs": 123
}
],
"flowInputs": [
{
"name": "<string>",
"value": "<string>"
}
],
"url": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>",
"auth": {},
"intervalMinutes": 123,
"timeoutMs": 123,
"lastTriggeredAt": "2023-11-07T05:31:56Z"
}
]Knowledge Bases
List Webhook Sources
Returns all webhook sources configured for a knowledge base.
Requires knowledge:view permission.
GET
/
api
/
knowledge-bases
/
{id}
/
webhooks
List webhook sources
curl --request GET \
--url https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks', 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.naturalead.ai/api/knowledge-bases/{id}/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.naturalead.ai/api/knowledge-bases/{id}/webhooks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"_id": "<string>",
"accountId": "<string>",
"knowledgeBaseId": "<string>",
"name": "<string>",
"enabled": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"steps": [
{
"name": "<string>",
"order": 123,
"url": "<string>",
"method": "GET",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"extractions": [
{
"variableName": "<string>",
"jsonPath": "<string>",
"useAsContext": false
}
],
"fanOut": {
"sourcePath": "<string>",
"itemVariable": "item",
"rateLimit": {
"delayMs": 123
}
},
"retry": {
"maxAttempts": 0,
"initialDelayMs": 1000,
"maxDelayMs": 30000,
"backoffMultiplier": 2
},
"onError": "fail",
"timeoutMs": 123
}
],
"flowInputs": [
{
"name": "<string>",
"value": "<string>"
}
],
"url": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>",
"auth": {},
"intervalMinutes": 123,
"timeoutMs": 123,
"lastTriggeredAt": "2023-11-07T05:31:56Z"
}
]Authorizations
Bearer token using an API key (format nl_live_* or nl_test_*)
Path Parameters
Knowledge base ID
Response
200 - application/json
List of webhook sources
Unique identifier
Owning account ID
Parent knowledge base ID
Webhook source name
Whether the webhook source is active
Ordered list of execution steps
Show child attributes
Show child attributes
Input variables for the step flow
Show child attributes
Show child attributes
URL to fetch content from
HTTP method
HTTP headers
Show child attributes
Show child attributes
Request body
Authentication configuration
Polling interval in minutes
Request timeout in milliseconds
Timestamp of the last trigger