curl --request DELETE \
--url https://api.naturalead.ai/api/agent-config/{id}/knowledge-bases/{kbId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.naturalead.ai/api/agent-config/{id}/knowledge-bases/{kbId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.naturalead.ai/api/agent-config/{id}/knowledge-bases/{kbId}', 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/agent-config/{id}/knowledge-bases/{kbId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/agent-config/{id}/knowledge-bases/{kbId}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.naturalead.ai/api/agent-config/{id}/knowledge-bases/{kbId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/agent-config/{id}/knowledge-bases/{kbId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"accountId": "<string>",
"name": "<string>",
"systemPrompt": "<string>",
"goal": "<string>",
"status": "active",
"language": "English",
"instructions": "<string>",
"qualificationCriteria": "<string>",
"handoffMessage": "I'll connect you with a specialist who can help further!",
"stages": [
{
"id": "<string>",
"name": "<string>",
"order": 123,
"prompt": "<string>",
"transitionCriteria": "<string>",
"maxMessages": 0,
"nextStages": [
{
"id": "<string>",
"condition": "<string>"
}
],
"nextStageIds": [
"<string>"
],
"knowledgeBaseIds": [
"<string>"
],
"stageInsights": [
{
"fieldName": "<string>",
"instructions": "<string>"
}
],
"position": {
"x": 123,
"y": 123
}
}
],
"inboundEntries": [
{
"targetStageId": "<string>",
"condition": "<string>"
}
],
"guardrails": {
"maxTotalMessages": 40,
"inactivityTimeoutMinutes": 1440,
"forbiddenTopics": "",
"escalationTriggers": ""
},
"knowledgeBaseIds": [
"<string>"
],
"mcpServerIds": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": "Agent not found"
}{
"error": "<string>"
}Detach Knowledge Base
Removes a knowledge base from the specified agent. The agent will
no longer use this knowledge base for RAG context.
Requires agent_config:edit permission.
curl --request DELETE \
--url https://api.naturalead.ai/api/agent-config/{id}/knowledge-bases/{kbId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.naturalead.ai/api/agent-config/{id}/knowledge-bases/{kbId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.naturalead.ai/api/agent-config/{id}/knowledge-bases/{kbId}', 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/agent-config/{id}/knowledge-bases/{kbId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/agent-config/{id}/knowledge-bases/{kbId}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.naturalead.ai/api/agent-config/{id}/knowledge-bases/{kbId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/agent-config/{id}/knowledge-bases/{kbId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"accountId": "<string>",
"name": "<string>",
"systemPrompt": "<string>",
"goal": "<string>",
"status": "active",
"language": "English",
"instructions": "<string>",
"qualificationCriteria": "<string>",
"handoffMessage": "I'll connect you with a specialist who can help further!",
"stages": [
{
"id": "<string>",
"name": "<string>",
"order": 123,
"prompt": "<string>",
"transitionCriteria": "<string>",
"maxMessages": 0,
"nextStages": [
{
"id": "<string>",
"condition": "<string>"
}
],
"nextStageIds": [
"<string>"
],
"knowledgeBaseIds": [
"<string>"
],
"stageInsights": [
{
"fieldName": "<string>",
"instructions": "<string>"
}
],
"position": {
"x": 123,
"y": 123
}
}
],
"inboundEntries": [
{
"targetStageId": "<string>",
"condition": "<string>"
}
],
"guardrails": {
"maxTotalMessages": 40,
"inactivityTimeoutMinutes": 1440,
"forbiddenTopics": "",
"escalationTriggers": ""
},
"knowledgeBaseIds": [
"<string>"
],
"mcpServerIds": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": "Agent not found"
}{
"error": "<string>"
}Authorizations
Bearer token using an API key (format nl_live_* or nl_test_*)
Path Parameters
Agent configuration ObjectId
Knowledge base ObjectId
Response
Updated agent configuration
MongoDB ObjectId
Account ObjectId this agent belongs to
Agent display name
System prompt sent to the LLM for every conversation
High-level goal for the agent
active, inactive, draft Conversation language
Additional instructions for the agent
Deprecated. Ignored by the conversation engine. Journey outcomes are terminal stages (no outgoing edges); advancement uses transitionCriteria and nextStages edge conditions.
Message sent when the conversation is handed off to a human
Ordered conversation stages
Show child attributes
Show child attributes
First-touch inbound landings (WhatsApp). Evaluated only when a conversation is created from an inbound message — not on later replies. Empty condition is the default landing.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
ObjectIds of attached knowledge bases
ObjectIds of attached MCP servers. Populated as full objects (minus
credentials) on GET /api/agent-config/{id}. Managed through the
dedicated attach/detach endpoints; sending it on create or update
also works and is validated for account ownership.