curl --request GET \
--url https://api.naturalead.ai/api/analytics/agent-funnels \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.naturalead.ai/api/analytics/agent-funnels"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.naturalead.ai/api/analytics/agent-funnels', 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/analytics/agent-funnels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.naturalead.ai/api/analytics/agent-funnels"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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/analytics/agent-funnels")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/analytics/agent-funnels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agents": [
{
"agentConfigId": "<string>",
"agentName": "<string>",
"agentStatus": "active",
"stages": [
{
"id": "<string>",
"name": "<string>",
"order": 123,
"nextStages": [
{
"id": "<string>",
"condition": "<string>"
}
],
"nextStageIds": [
"<string>"
],
"position": {
"x": 123,
"y": 123
}
}
],
"inboundEntries": [
{
"targetStageId": "<string>",
"condition": "<string>"
}
],
"totals": {
"conversations": 123,
"replied": 123,
"active": 123,
"completed": 123,
"handedOff": 123,
"dropped": 123,
"unmapped": 123
},
"stageStats": [
{
"stageId": "<string>",
"reached": 123,
"entered": 123,
"active": 123,
"completed": 123,
"handedOff": 123,
"dropped": 123
}
],
"edgeStats": [
{
"source": "<string>",
"target": "<string>",
"count": 123
}
]
}
]
}{
"error": "<string>"
}{
"error": "Failed to process request"
}Agent Funnels
Cohort funnel for every agent in the account. The cohort is the
non-archived conversations started in the window; each one is traced
through its stage_transitioned events up to now. Returns the agent’s
stage graph (as drawn in the agent editor) alongside how many
conversations reached each stage, which edges they took, and where they
are now. Agents with no conversations are included with zero counts.
Requires analytics:view permission.
curl --request GET \
--url https://api.naturalead.ai/api/analytics/agent-funnels \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.naturalead.ai/api/analytics/agent-funnels"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.naturalead.ai/api/analytics/agent-funnels', 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/analytics/agent-funnels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.naturalead.ai/api/analytics/agent-funnels"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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/analytics/agent-funnels")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/analytics/agent-funnels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agents": [
{
"agentConfigId": "<string>",
"agentName": "<string>",
"agentStatus": "active",
"stages": [
{
"id": "<string>",
"name": "<string>",
"order": 123,
"nextStages": [
{
"id": "<string>",
"condition": "<string>"
}
],
"nextStageIds": [
"<string>"
],
"position": {
"x": 123,
"y": 123
}
}
],
"inboundEntries": [
{
"targetStageId": "<string>",
"condition": "<string>"
}
],
"totals": {
"conversations": 123,
"replied": 123,
"active": 123,
"completed": 123,
"handedOff": 123,
"dropped": 123,
"unmapped": 123
},
"stageStats": [
{
"stageId": "<string>",
"reached": 123,
"entered": 123,
"active": 123,
"completed": 123,
"handedOff": 123,
"dropped": 123
}
],
"edgeStats": [
{
"source": "<string>",
"target": "<string>",
"count": 123
}
]
}
]
}{
"error": "<string>"
}{
"error": "Failed to process request"
}Authorizations
API key for programmatic access. Keys use the format nl_live_<64 hex>
or nl_test_<64 hex> and are scoped to an account's RBAC permissions.
Query Parameters
Shorthand window ending now. Ignored when from or to is given.
7d, 30d, 90d Inclusive start of the window (ISO-8601 timestamp).
Exclusive end of the window (ISO-8601 timestamp). Defaults to now. The window may span at most 366 days.
IANA timezone used to bucket /daily. Unknown values fall back to UTC.
"Asia/Jerusalem"
Response
Agent funnels
Show child attributes
Show child attributes