curl --request POST \
--url https://api.naturalead.ai/api/agent-config/apply-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "<string>"
}
'import requests
url = "https://api.naturalead.ai/api/agent-config/apply-template"
payload = { "templateId": "<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({templateId: '<string>'})
};
fetch('https://api.naturalead.ai/api/agent-config/apply-template', 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/apply-template",
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([
'templateId' => '<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/agent-config/apply-template"
payload := strings.NewReader("{\n \"templateId\": \"<string>\"\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/agent-config/apply-template")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"templateId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/agent-config/apply-template")
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 \"templateId\": \"<string>\"\n}"
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": "Template not found"
}{
"error": "<string>"
}Apply Template
Returns the full agent configuration for a given template without
persisting it. The caller can review and modify the configuration
before saving it via createAgent or updateAgent.
Requires agent_config:edit permission.
curl --request POST \
--url https://api.naturalead.ai/api/agent-config/apply-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "<string>"
}
'import requests
url = "https://api.naturalead.ai/api/agent-config/apply-template"
payload = { "templateId": "<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({templateId: '<string>'})
};
fetch('https://api.naturalead.ai/api/agent-config/apply-template', 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/apply-template",
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([
'templateId' => '<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/agent-config/apply-template"
payload := strings.NewReader("{\n \"templateId\": \"<string>\"\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/agent-config/apply-template")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"templateId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/agent-config/apply-template")
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 \"templateId\": \"<string>\"\n}"
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": "Template not found"
}{
"error": "<string>"
}Authorizations
Bearer token using an API key (format nl_live_* or nl_test_*)
Body
ID of the template to apply
Response
Template configuration (not persisted)
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.