curl --request GET \
--url https://www.chatbase.co/api/v2/agents/{agentId}/conversations/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v2/agents/{agentId}/conversations/search"
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}/conversations/search', 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}/conversations/search",
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}/conversations/search"
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}/conversations/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v2/agents/{agentId}/conversations/search")
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{
"data": [
{
"id": "<string>",
"title": "<string>",
"createdAt": 123,
"updatedAt": 123,
"userId": "<string>",
"source": "API",
"embedOrigin": "https://www.example.com",
"status": "ongoing",
"snippet": {
"speaker": "user",
"highlights": [
{
"value": "<string>",
"isHit": true
}
]
},
"parentConversationId": "<string>",
"parentSummary": "<string>"
}
],
"pagination": {
"cursor": "<string>",
"hasMore": true
}
}Search conversations
Search an agent’s conversations across all sources by text, filters, or both. With query, results are ranked and carry a highlighted snippet; without it, most recently active first. Filters combine with AND; comma-separated values within a filter with OR. Covers conversations created since the 1st of the month 12 months ago (UTC), activity-date filters included. Results lag new messages by a few seconds. A page can hold fewer than limit items, even none, while hasMore is true; keep following the cursor. Read messages via export with conversationId.
curl --request GET \
--url https://www.chatbase.co/api/v2/agents/{agentId}/conversations/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v2/agents/{agentId}/conversations/search"
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}/conversations/search', 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}/conversations/search",
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}/conversations/search"
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}/conversations/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v2/agents/{agentId}/conversations/search")
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{
"data": [
{
"id": "<string>",
"title": "<string>",
"createdAt": 123,
"updatedAt": 123,
"userId": "<string>",
"source": "API",
"embedOrigin": "https://www.example.com",
"status": "ongoing",
"snippet": {
"speaker": "user",
"highlights": [
{
"value": "<string>",
"isHit": true
}
]
},
"parentConversationId": "<string>",
"parentSummary": "<string>"
}
],
"pagination": {
"cursor": "<string>",
"hasMore": true
}
}Authorizations
API key from your account settings
Path Parameters
The agent ID
1"5QHA6VB-DIAbBhxwqxfdi"
Query Parameters
Created at or after this point (YYYY-MM-DD or ISO 8601). Must be inside the searchable window.
Created at or before this point (YYYY-MM-DD, inclusive, or ISO 8601).
Free-text search over messages and titles.
512"refund"
Comma-separated sources, e.g. API,WhatsApp.
"Widget or Iframe"
Comma-separated: positive, neutral, negative, or unspecified for none.
"negative"
Comma-separated topic names, or unspecified for none.
"billing"
Comma-separated user IDs.
Comma-separated: ongoing, ended, taken_over, paused.
"taken_over"
Comma-separated message ratings: positive, negative.
"negative"
true: only conversations escalated to a human (ticket or live-chat handoff).
true "true"
Comma-separated action types that ran, e.g. collect-leads.
Comma-separated tool names that were called.
Comma-separated tool result statuses, e.g. error. Scoped to tool when set.
"error"
Comma-separated procedure names that ran.
Comma-separated procedure run statuses. Scoped to procedure when set.
"completed"
Whether a voice session took place.
true, false Last active at or after this point (YYYY-MM-DD or ISO 8601).
Last active at or before this point (YYYY-MM-DD, inclusive, or ISO 8601).
pagination.cursor from the previous page. Keep the other parameters unchanged.
2048Items per page (1 to 25, default 25)
1 <= x <= 2525
