curl --request POST \
--url https://api.closebot.com/analytics/topics \
--header 'Content-Type: application/json' \
--header 'X-CB-KEY: <api-key>' \
--data '
{
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"limit": 123,
"filters": {
"sourceIds": [
"<string>"
],
"dimensions": [
{
"dimension": "<string>",
"operator": "<string>",
"values": [
"<string>"
]
}
]
}
}
'import requests
url = "https://api.closebot.com/analytics/topics"
payload = {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"limit": 123,
"filters": {
"sourceIds": ["<string>"],
"dimensions": [
{
"dimension": "<string>",
"operator": "<string>",
"values": ["<string>"]
}
]
}
}
headers = {
"X-CB-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-CB-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '2023-11-07T05:31:56Z',
end: '2023-11-07T05:31:56Z',
limit: 123,
filters: {
sourceIds: ['<string>'],
dimensions: [{dimension: '<string>', operator: '<string>', values: ['<string>']}]
}
})
};
fetch('https://api.closebot.com/analytics/topics', 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.closebot.com/analytics/topics",
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([
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z',
'limit' => 123,
'filters' => [
'sourceIds' => [
'<string>'
],
'dimensions' => [
[
'dimension' => '<string>',
'operator' => '<string>',
'values' => [
'<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CB-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.closebot.com/analytics/topics"
payload := strings.NewReader("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"limit\": 123,\n \"filters\": {\n \"sourceIds\": [\n \"<string>\"\n ],\n \"dimensions\": [\n {\n \"dimension\": \"<string>\",\n \"operator\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CB-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.post("https://api.closebot.com/analytics/topics")
.header("X-CB-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"limit\": 123,\n \"filters\": {\n \"sourceIds\": [\n \"<string>\"\n ],\n \"dimensions\": [\n {\n \"dimension\": \"<string>\",\n \"operator\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.closebot.com/analytics/topics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CB-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"limit\": 123,\n \"filters\": {\n \"sourceIds\": [\n \"<string>\"\n ],\n \"dimensions\": [\n {\n \"dimension\": \"<string>\",\n \"operator\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"topics": [
{
"topicId": "<string>",
"name": "<string>",
"slug": "<string>",
"conversationCount": 123,
"sentimentCount": 123,
"series": [
{
"date": "2023-12-25",
"count": 123,
"avgSentiment": 123
}
],
"avgSentiment": 123
}
],
"analyzedConversations": 123,
"pendingConversations": 123,
"sentimentCoverage": 123,
"oldestAnalyzedOn": "2023-12-25"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Topic treemap and per-topic daily series for the active agency.
A dedicated endpoint rather than another metric on /analytics/query, for three reasons: AnalyticsQueryPoint.Value is an int and average sentiment is a nullable double; the treemap and its sparklines must come from one snapshot or a batch landing mid-request can make the rectangles disagree with the trend lines; and Query’s validator hard-requires 15-minute alignment while topics are day-grained.
curl --request POST \
--url https://api.closebot.com/analytics/topics \
--header 'Content-Type: application/json' \
--header 'X-CB-KEY: <api-key>' \
--data '
{
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"limit": 123,
"filters": {
"sourceIds": [
"<string>"
],
"dimensions": [
{
"dimension": "<string>",
"operator": "<string>",
"values": [
"<string>"
]
}
]
}
}
'import requests
url = "https://api.closebot.com/analytics/topics"
payload = {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"limit": 123,
"filters": {
"sourceIds": ["<string>"],
"dimensions": [
{
"dimension": "<string>",
"operator": "<string>",
"values": ["<string>"]
}
]
}
}
headers = {
"X-CB-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-CB-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '2023-11-07T05:31:56Z',
end: '2023-11-07T05:31:56Z',
limit: 123,
filters: {
sourceIds: ['<string>'],
dimensions: [{dimension: '<string>', operator: '<string>', values: ['<string>']}]
}
})
};
fetch('https://api.closebot.com/analytics/topics', 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.closebot.com/analytics/topics",
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([
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z',
'limit' => 123,
'filters' => [
'sourceIds' => [
'<string>'
],
'dimensions' => [
[
'dimension' => '<string>',
'operator' => '<string>',
'values' => [
'<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CB-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.closebot.com/analytics/topics"
payload := strings.NewReader("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"limit\": 123,\n \"filters\": {\n \"sourceIds\": [\n \"<string>\"\n ],\n \"dimensions\": [\n {\n \"dimension\": \"<string>\",\n \"operator\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CB-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.post("https://api.closebot.com/analytics/topics")
.header("X-CB-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"limit\": 123,\n \"filters\": {\n \"sourceIds\": [\n \"<string>\"\n ],\n \"dimensions\": [\n {\n \"dimension\": \"<string>\",\n \"operator\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.closebot.com/analytics/topics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CB-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"limit\": 123,\n \"filters\": {\n \"sourceIds\": [\n \"<string>\"\n ],\n \"dimensions\": [\n {\n \"dimension\": \"<string>\",\n \"operator\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"topics": [
{
"topicId": "<string>",
"name": "<string>",
"slug": "<string>",
"conversationCount": 123,
"sentimentCount": 123,
"series": [
{
"date": "2023-12-25",
"count": 123,
"avgSentiment": 123
}
],
"avgSentiment": 123
}
],
"analyzedConversations": 123,
"pendingConversations": 123,
"sentimentCoverage": 123,
"oldestAnalyzedOn": "2023-12-25"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
CloseBot API Key Authorization
Body
Response
OK
Show child attributes
Show child attributes
Distinct conversations with at least one topic in range.
Conversations on topic-enabled sources that have never been classified, agency-wide.
Deliberately not scoped to the requested range. A range-scoped backlog would need each unanalysed conversation's start date, which means MIN(Message.Time) per lead — the scan of the Messages table that this feature's whole design avoids. An agency-wide number is cheap, and the UI must label it as such rather than implying a percentage.
Share of Closebot.Api.Controllers.AnalyticsController.TopicsQueryResponse.AnalyzedConversations carrying a sentiment reading, 0-1. Below 1 means some sources have Sentiment switched off.
Earliest conversation start date with any topic, agency-wide. Lets the UI say "topics from 3 Mar" so the forward-only cutover reads as a cutover and not a data gap.

