Get agent analytics
curl --request GET \
--url https://www.chatbase.co/api/v2/agents/{agentId}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v2/agents/{agentId}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.chatbase.co/api/v2/agents/{agentId}/analytics', 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://www.chatbase.co/api/v2/agents/{agentId}/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://www.chatbase.co/api/v2/agents/{agentId}/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.chatbase.co/api/v2/agents/{agentId}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v2/agents/{agentId}/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"buckets": [
{
"start": 123,
"end": 123,
"conversations": 123,
"messages": 123,
"positive": 123,
"neutral": 123,
"negative": 123,
"escalated": 123,
"thumbsUp": 123,
"thumbsDown": 123,
"ticketsByStatus": [
{
"value": "new",
"count": 123
}
],
"procedures": [
{
"value": "<string>",
"count": 123
}
],
"tools": [
{
"value": "<string>",
"count": 123
}
],
"actionTypes": [
{
"value": "<string>",
"count": 123
}
]
}
],
"sources": [
{
"value": "<string>",
"count": 123
}
],
"toolsUsed": [
{
"value": "<string>",
"count": 123
}
],
"countries": [
{
"value": "<string>",
"count": 123
}
],
"confidence": [
123
],
"conversationsByHour": [
123
],
"creditsByDay": [
{
"date": "<string>",
"credits": 123
}
]
}Agents
Get agent analytics
Returns an agent’s activity over a date range split into 7 equal buckets: conversations, messages, sentiment, escalations, ratings, help desk tickets, procedure runs, tool calls and action types per bucket. For the whole range it adds conversation counts by source, action, country, answer confidence and hour of day, plus credits per day. Conversations count by last activity, and the range must fall inside the searchable window (since the 1st of the month 12 months ago, UTC).
GET
/
agents
/
{agentId}
/
analytics
Get agent analytics
curl --request GET \
--url https://www.chatbase.co/api/v2/agents/{agentId}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v2/agents/{agentId}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.chatbase.co/api/v2/agents/{agentId}/analytics', 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://www.chatbase.co/api/v2/agents/{agentId}/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://www.chatbase.co/api/v2/agents/{agentId}/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.chatbase.co/api/v2/agents/{agentId}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v2/agents/{agentId}/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"buckets": [
{
"start": 123,
"end": 123,
"conversations": 123,
"messages": 123,
"positive": 123,
"neutral": 123,
"negative": 123,
"escalated": 123,
"thumbsUp": 123,
"thumbsDown": 123,
"ticketsByStatus": [
{
"value": "new",
"count": 123
}
],
"procedures": [
{
"value": "<string>",
"count": 123
}
],
"tools": [
{
"value": "<string>",
"count": 123
}
],
"actionTypes": [
{
"value": "<string>",
"count": 123
}
]
}
],
"sources": [
{
"value": "<string>",
"count": 123
}
],
"toolsUsed": [
{
"value": "<string>",
"count": 123
}
],
"countries": [
{
"value": "<string>",
"count": 123
}
],
"confidence": [
123
],
"conversationsByHour": [
123
],
"creditsByDay": [
{
"date": "<string>",
"credits": 123
}
]
}Path Parameters
Query Parameters
Response
Agent analytics for the range