List the records behind a metric
curl --request POST \
--url https://api.getcluster.ai/v1/analytics/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"timezone": "UTC",
"scope": [
{
"value": "<string>"
}
],
"metric": "leads_reached",
"population": "numerator"
}
'import requests
url = "https://api.getcluster.ai/v1/analytics/records"
payload = {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"timezone": "UTC",
"scope": [{ "value": "<string>" }],
"metric": "leads_reached",
"population": "numerator"
}
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({
start_date: '2023-12-25',
end_date: '2023-12-25',
timezone: 'UTC',
scope: [{value: '<string>'}],
metric: 'leads_reached',
population: 'numerator'
})
};
fetch('https://api.getcluster.ai/v1/analytics/records', 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.getcluster.ai/v1/analytics/records",
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_date' => '2023-12-25',
'end_date' => '2023-12-25',
'timezone' => 'UTC',
'scope' => [
[
'value' => '<string>'
]
],
'metric' => 'leads_reached',
'population' => 'numerator'
]),
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.getcluster.ai/v1/analytics/records"
payload := strings.NewReader("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"timezone\": \"UTC\",\n \"scope\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metric\": \"leads_reached\",\n \"population\": \"numerator\"\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.getcluster.ai/v1/analytics/records")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"timezone\": \"UTC\",\n \"scope\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metric\": \"leads_reached\",\n \"population\": \"numerator\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getcluster.ai/v1/analytics/records")
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 \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"timezone\": \"UTC\",\n \"scope\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metric\": \"leads_reached\",\n \"population\": \"numerator\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"kind": "<string>",
"name": "<string>",
"dimensions": {},
"labels": {},
"classification": "<string>",
"contact_id": "<string>",
"campaign_id": "<string>",
"conversation_id": "<string>"
}
],
"next_cursor": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}Analytics
List the records behind a metric
Reads only; nothing is changed. Send the same body with each page’s cursor.
POST
/
v1
/
analytics
/
records
List the records behind a metric
curl --request POST \
--url https://api.getcluster.ai/v1/analytics/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"timezone": "UTC",
"scope": [
{
"value": "<string>"
}
],
"metric": "leads_reached",
"population": "numerator"
}
'import requests
url = "https://api.getcluster.ai/v1/analytics/records"
payload = {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"timezone": "UTC",
"scope": [{ "value": "<string>" }],
"metric": "leads_reached",
"population": "numerator"
}
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({
start_date: '2023-12-25',
end_date: '2023-12-25',
timezone: 'UTC',
scope: [{value: '<string>'}],
metric: 'leads_reached',
population: 'numerator'
})
};
fetch('https://api.getcluster.ai/v1/analytics/records', 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.getcluster.ai/v1/analytics/records",
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_date' => '2023-12-25',
'end_date' => '2023-12-25',
'timezone' => 'UTC',
'scope' => [
[
'value' => '<string>'
]
],
'metric' => 'leads_reached',
'population' => 'numerator'
]),
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.getcluster.ai/v1/analytics/records"
payload := strings.NewReader("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"timezone\": \"UTC\",\n \"scope\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metric\": \"leads_reached\",\n \"population\": \"numerator\"\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.getcluster.ai/v1/analytics/records")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"timezone\": \"UTC\",\n \"scope\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metric\": \"leads_reached\",\n \"population\": \"numerator\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getcluster.ai/v1/analytics/records")
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 \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"timezone\": \"UTC\",\n \"scope\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"metric\": \"leads_reached\",\n \"population\": \"numerator\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"kind": "<string>",
"name": "<string>",
"dimensions": {},
"labels": {},
"classification": "<string>",
"contact_id": "<string>",
"campaign_id": "<string>",
"conversation_id": "<string>"
}
],
"next_cursor": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}Authorizations
Body
application/json
Which records to list. Paging is in the query string, so the filters stay the same between pages.
Available options:
leads_reached, replies, reply_rate, invitations_sent, invitations_accepted, acceptance_rate, messages_sent, emails_sent, calls_made, call_conversations, call_conversation_rate, positive_replies, positive_reply_rate, classified_replies, unclassified_replies, classification_coverage