curl --request PATCH \
--url https://api.naturalead.ai/api/preferences/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"preference": "$75k-120k",
"confidence": "high"
}
'import requests
url = "https://api.naturalead.ai/api/preferences/{id}"
payload = {
"preference": "$75k-120k",
"confidence": "high"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({preference: '$75k-120k', confidence: 'high'})
};
fetch('https://api.naturalead.ai/api/preferences/{id}', 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/preferences/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'preference' => '$75k-120k',
'confidence' => 'high'
]),
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.naturalead.ai/api/preferences/{id}"
payload := strings.NewReader("{\n \"preference\": \"$75k-120k\",\n \"confidence\": \"high\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.naturalead.ai/api/preferences/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"preference\": \"$75k-120k\",\n \"confidence\": \"high\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/preferences/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"preference\": \"$75k-120k\",\n \"confidence\": \"high\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"leadId": "<string>",
"topic": "<string>",
"preference": "<string>",
"confidence": "high",
"accountId": "<string>",
"conversationId": "<string>",
"source": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}Update a Lead Insight
Updates topic, preference text, and/or confidence for one insight.
Path {id} here is the preference document _id (MongoDB ObjectId),
not the lead id.
Requires conversations:edit permission.
curl --request PATCH \
--url https://api.naturalead.ai/api/preferences/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"preference": "$75k-120k",
"confidence": "high"
}
'import requests
url = "https://api.naturalead.ai/api/preferences/{id}"
payload = {
"preference": "$75k-120k",
"confidence": "high"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({preference: '$75k-120k', confidence: 'high'})
};
fetch('https://api.naturalead.ai/api/preferences/{id}', 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/preferences/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'preference' => '$75k-120k',
'confidence' => 'high'
]),
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.naturalead.ai/api/preferences/{id}"
payload := strings.NewReader("{\n \"preference\": \"$75k-120k\",\n \"confidence\": \"high\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.naturalead.ai/api/preferences/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"preference\": \"$75k-120k\",\n \"confidence\": \"high\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/preferences/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"preference\": \"$75k-120k\",\n \"confidence\": \"high\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"leadId": "<string>",
"topic": "<string>",
"preference": "<string>",
"confidence": "high",
"accountId": "<string>",
"conversationId": "<string>",
"source": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}Authorizations
API key for programmatic access (format nl_live_* or nl_test_*)
Path Parameters
MongoDB ObjectId of the preference document.
Body
Response
Updated insight.
A single extracted lead insight (preference). Unique per
(accountId, leadId, topic) — updates overwrite the same topic.
Preference document id.
Lead id these insights belong to.
Preference domain (e.g. budget, timeline, location).
100Extracted value for the topic.
200Model confidence in the extraction.
high, medium, low Owning account id.
Conversation that last wrote or updated this insight.
Short snippet or provenance of the extraction.
TTL expiry (default ~90 days from last write).