curl --request GET \
--url https://api.naturalead.ai/api/analytics/overview \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.naturalead.ai/api/analytics/overview"
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/overview', 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/overview",
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/overview"
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/overview")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/analytics/overview")
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{
"totalLeads": 123,
"totalConversations": 123,
"responseRate": 123,
"avgMessages": 123,
"completedRate": 123,
"handedOffRate": 123,
"sessionStatus": {
"active": 123,
"completed": 123,
"handed_off": 123,
"dropped": 123
},
"qualificationRate": 123,
"avgMessagesToQualify": 123
}{
"error": "Failed to process request"
}Overview Stats
Returns high-level analytics overview for the current account:
total leads, conversations in range, response / completed / handed-off
rates, average messages, and session status mix.
Requires analytics:view permission.
curl --request GET \
--url https://api.naturalead.ai/api/analytics/overview \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.naturalead.ai/api/analytics/overview"
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/overview', 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/overview",
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/overview"
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/overview")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/analytics/overview")
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{
"totalLeads": 123,
"totalConversations": 123,
"responseRate": 123,
"avgMessages": 123,
"completedRate": 123,
"handedOffRate": 123,
"sessionStatus": {
"active": 123,
"completed": 123,
"handed_off": 123,
"dropped": 123
},
"qualificationRate": 123,
"avgMessagesToQualify": 123
}{
"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
Time range for analytics data
7d, 30d, 90d Response
Analytics overview
High-level analytics overview for the account.
Total number of leads in the account
Conversations started within the selected range
Percentage of conversations where the lead sent at least one message
Average message count across conversations in range
Percentage of conversations with status completed
Percentage of conversations with status handed_off
Show child attributes
Show child attributes
Deprecated. Percentage of conversations with historical
qualificationResult.qualified === true. Prefer completedRate /
stage-distribution.
Deprecated. Prefer avgMessages.