Aggregate
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/insights/aggregate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity": "episodes",
"since": "2026-06-24T00:00:00Z",
"until": "2026-09-22T23:59:59Z",
"filters": {
"intent": [
"complaint"
]
},
"group_by": [
"normalized_category",
"channel"
],
"metrics": [
"count",
"profiles"
]
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/insights/aggregate"
payload = {
"entity": "episodes",
"since": "2026-06-24T00:00:00Z",
"until": "2026-09-22T23:59:59Z",
"filters": { "intent": ["complaint"] },
"group_by": ["normalized_category", "channel"],
"metrics": ["count", "profiles"]
}
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({
entity: 'episodes',
since: '2026-06-24T00:00:00Z',
until: '2026-09-22T23:59:59Z',
filters: {intent: ['complaint']},
group_by: ['normalized_category', 'channel'],
metrics: ['count', 'profiles']
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/insights/aggregate', 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://{space}.{region}.api.niadra.com/v1/insights/aggregate",
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([
'entity' => 'episodes',
'since' => '2026-06-24T00:00:00Z',
'until' => '2026-09-22T23:59:59Z',
'filters' => [
'intent' => [
'complaint'
]
],
'group_by' => [
'normalized_category',
'channel'
],
'metrics' => [
'count',
'profiles'
]
]),
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://{space}.{region}.api.niadra.com/v1/insights/aggregate"
payload := strings.NewReader("{\n \"entity\": \"episodes\",\n \"since\": \"2026-06-24T00:00:00Z\",\n \"until\": \"2026-09-22T23:59:59Z\",\n \"filters\": {\n \"intent\": [\n \"complaint\"\n ]\n },\n \"group_by\": [\n \"normalized_category\",\n \"channel\"\n ],\n \"metrics\": [\n \"count\",\n \"profiles\"\n ]\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://{space}.{region}.api.niadra.com/v1/insights/aggregate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity\": \"episodes\",\n \"since\": \"2026-06-24T00:00:00Z\",\n \"until\": \"2026-09-22T23:59:59Z\",\n \"filters\": {\n \"intent\": [\n \"complaint\"\n ]\n },\n \"group_by\": [\n \"normalized_category\",\n \"channel\"\n ],\n \"metrics\": [\n \"count\",\n \"profiles\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/insights/aggregate")
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 \"entity\": \"episodes\",\n \"since\": \"2026-06-24T00:00:00Z\",\n \"until\": \"2026-09-22T23:59:59Z\",\n \"filters\": {\n \"intent\": [\n \"complaint\"\n ]\n },\n \"group_by\": [\n \"normalized_category\",\n \"channel\"\n ],\n \"metrics\": [\n \"count\",\n \"profiles\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"min_group_size": 10,
"suppressed_groups": 3,
"rows": [
{
"group": {
"normalized_category": "technician_visit",
"channel": "voice"
},
"count": 1204,
"profiles": 1030,
"avg_sentiment": null
},
{
"group": {
"normalized_category": "technician_visit",
"channel": "whatsapp"
},
"count": 636,
"profiles": 588,
"avg_sentiment": null
}
]
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Base-wide analysis
Aggregate
Counts and rates across all customers, pseudonymous by default.
POST
/
v1
/
insights
/
aggregate
Aggregate
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/insights/aggregate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entity": "episodes",
"since": "2026-06-24T00:00:00Z",
"until": "2026-09-22T23:59:59Z",
"filters": {
"intent": [
"complaint"
]
},
"group_by": [
"normalized_category",
"channel"
],
"metrics": [
"count",
"profiles"
]
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/insights/aggregate"
payload = {
"entity": "episodes",
"since": "2026-06-24T00:00:00Z",
"until": "2026-09-22T23:59:59Z",
"filters": { "intent": ["complaint"] },
"group_by": ["normalized_category", "channel"],
"metrics": ["count", "profiles"]
}
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({
entity: 'episodes',
since: '2026-06-24T00:00:00Z',
until: '2026-09-22T23:59:59Z',
filters: {intent: ['complaint']},
group_by: ['normalized_category', 'channel'],
metrics: ['count', 'profiles']
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/insights/aggregate', 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://{space}.{region}.api.niadra.com/v1/insights/aggregate",
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([
'entity' => 'episodes',
'since' => '2026-06-24T00:00:00Z',
'until' => '2026-09-22T23:59:59Z',
'filters' => [
'intent' => [
'complaint'
]
],
'group_by' => [
'normalized_category',
'channel'
],
'metrics' => [
'count',
'profiles'
]
]),
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://{space}.{region}.api.niadra.com/v1/insights/aggregate"
payload := strings.NewReader("{\n \"entity\": \"episodes\",\n \"since\": \"2026-06-24T00:00:00Z\",\n \"until\": \"2026-09-22T23:59:59Z\",\n \"filters\": {\n \"intent\": [\n \"complaint\"\n ]\n },\n \"group_by\": [\n \"normalized_category\",\n \"channel\"\n ],\n \"metrics\": [\n \"count\",\n \"profiles\"\n ]\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://{space}.{region}.api.niadra.com/v1/insights/aggregate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entity\": \"episodes\",\n \"since\": \"2026-06-24T00:00:00Z\",\n \"until\": \"2026-09-22T23:59:59Z\",\n \"filters\": {\n \"intent\": [\n \"complaint\"\n ]\n },\n \"group_by\": [\n \"normalized_category\",\n \"channel\"\n ],\n \"metrics\": [\n \"count\",\n \"profiles\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/insights/aggregate")
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 \"entity\": \"episodes\",\n \"since\": \"2026-06-24T00:00:00Z\",\n \"until\": \"2026-09-22T23:59:59Z\",\n \"filters\": {\n \"intent\": [\n \"complaint\"\n ]\n },\n \"group_by\": [\n \"normalized_category\",\n \"channel\"\n ],\n \"metrics\": [\n \"count\",\n \"profiles\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"min_group_size": 10,
"suppressed_groups": 3,
"rows": [
{
"group": {
"normalized_category": "technician_visit",
"channel": "voice"
},
"count": 1204,
"profiles": 1030,
"avg_sentiment": null
},
{
"group": {
"normalized_category": "technician_visit",
"channel": "whatsapp"
},
"count": 636,
"profiles": 588,
"avg_sentiment": null
}
]
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Authorizations
nia_sk_...
Body
application/json

