curl --request GET \
--url https://www.chatbase.co/api/v2/agents/{agentId}/sources/summary \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v2/agents/{agentId}/sources/summary"
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}/sources/summary', 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}/sources/summary",
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}/sources/summary"
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}/sources/summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v2/agents/{agentId}/sources/summary")
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{
"links": {
"count": 123,
"size": 123
},
"files": {
"count": 123,
"size": 123
},
"qnas": {
"count": 123,
"size": 123
},
"notionPages": {
"count": 123,
"size": 123
},
"texts": {
"count": 123,
"size": 123
},
"zendeskTickets": {
"count": 123,
"size": 123
},
"salesforceCases": {
"count": 123,
"size": 123
},
"shouldRetrain": true
}{
"error": {
"code": "AUTH_MISSING_API_KEY",
"message": "Authentication required"
}
}{
"error": {
"code": "SUBSCRIPTION_API_RESTRICTED_PLAN",
"message": "A Standard plan or higher is required to access the API"
}
}{
"error": {
"code": "RATE_LIMIT_TOO_MANY_REQUESTS",
"message": "Too many requests, please try again later"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Something went wrong, please try again"
}
}{
"error": {
"code": "SERVICE_UNDER_MAINTENANCE",
"message": "The API is temporarily unavailable for scheduled maintenance, please try again later"
}
}Get sources summary
Returns aggregated counts and sizes for each source type, plus a flag if the chatbot knowledge base requires a retrain to reflect any changes
curl --request GET \
--url https://www.chatbase.co/api/v2/agents/{agentId}/sources/summary \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v2/agents/{agentId}/sources/summary"
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}/sources/summary', 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}/sources/summary",
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}/sources/summary"
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}/sources/summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v2/agents/{agentId}/sources/summary")
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{
"links": {
"count": 123,
"size": 123
},
"files": {
"count": 123,
"size": 123
},
"qnas": {
"count": 123,
"size": 123
},
"notionPages": {
"count": 123,
"size": 123
},
"texts": {
"count": 123,
"size": 123
},
"zendeskTickets": {
"count": 123,
"size": 123
},
"salesforceCases": {
"count": 123,
"size": 123
},
"shouldRetrain": true
}{
"error": {
"code": "AUTH_MISSING_API_KEY",
"message": "Authentication required"
}
}{
"error": {
"code": "SUBSCRIPTION_API_RESTRICTED_PLAN",
"message": "A Standard plan or higher is required to access the API"
}
}{
"error": {
"code": "RATE_LIMIT_TOO_MANY_REQUESTS",
"message": "Too many requests, please try again later"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Something went wrong, please try again"
}
}{
"error": {
"code": "SERVICE_UNDER_MAINTENANCE",
"message": "The API is temporarily unavailable for scheduled maintenance, please try again later"
}
}Authorizations
API key from your account settings
Path Parameters
The agent ID
1"5QHA6VB-DIAbBhxwqxfdi"
Response
Sources summary by type
Aggregated stats for link sources
Show child attributes
Show child attributes
Aggregated stats for file sources
Show child attributes
Show child attributes
Aggregated stats for Q&A sources
Show child attributes
Show child attributes
Aggregated stats for Notion sources
Show child attributes
Show child attributes
Aggregated stats for text sources
Show child attributes
Show child attributes
Aggregated stats for Zendesk ticket sources. count = total number of ticket IDs tracked
Show child attributes
Show child attributes
Aggregated stats for Salesforce case sources. count = total number of case IDs tracked
Show child attributes
Show child attributes
True when the agent knowledge base requires a retrain to reflect any changes
