Trigger webhook source
curl --request POST \
--url https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"flowInputs": [
{
"name": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger"
payload = { "flowInputs": [
{
"name": "<string>",
"value": "<string>"
}
] }
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({flowInputs: [{name: '<string>', value: '<string>'}]})
};
fetch('https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger', 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/{whId}/trigger",
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([
'flowInputs' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
]),
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://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger"
payload := strings.NewReader("{\n \"flowInputs\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\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://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"flowInputs\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger")
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 \"flowInputs\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
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"
}{
"error": "<string>"
}Knowledge Bases
Trigger Webhook Source
Manually triggers a webhook source to fetch and ingest content
immediately, regardless of its polling schedule.
Requires knowledge:upload permission.
POST
/
api
/
knowledge-bases
/
{id}
/
webhooks
/
{whId}
/
trigger
Trigger webhook source
curl --request POST \
--url https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"flowInputs": [
{
"name": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger"
payload = { "flowInputs": [
{
"name": "<string>",
"value": "<string>"
}
] }
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({flowInputs: [{name: '<string>', value: '<string>'}]})
};
fetch('https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger', 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/{whId}/trigger",
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([
'flowInputs' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
]),
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://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger"
payload := strings.NewReader("{\n \"flowInputs\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\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://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"flowInputs\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/knowledge-bases/{id}/webhooks/{whId}/trigger")
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 \"flowInputs\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
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"
}{
"error": "<string>"
}Authorizations
Bearer token using an API key (format nl_live_* or nl_test_*)
Body
application/json
Optional flow input overrides for this trigger
Show child attributes
Show child attributes
Response
Triggered webhook source
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