curl --request GET \
--url https://www.chatbase.co/api/v2/agents/{agentId}/conversations/export \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v2/agents/{agentId}/conversations/export"
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/export', 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/export",
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/export"
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/export")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v2/agents/{agentId}/conversations/export")
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",
"status": "ongoing",
"messages": [
{
"id": "<string>",
"role": "user",
"parts": [
{
"type": "text",
"text": "<string>"
}
],
"createdAt": 123,
"feedback": "positive",
"metadata": {
"score": 123
}
}
]
}
],
"pagination": {
"cursor": "<string>",
"hasMore": true,
"total": 123
}
}Export conversations
Export all conversations with full message history for an agent. Includes conversations from all sources. Tool results are sanitized to remove internal data. Supports cursor-based pagination. Pass conversationId to fetch a single conversation from any source (widget, API, WhatsApp, etc.). Pass include=summary to omit message bodies for a cheaper triage pass, source to restrict to one or more conversation sources, and startDate / endDate to restrict to a createdAt window.
curl --request GET \
--url https://www.chatbase.co/api/v2/agents/{agentId}/conversations/export \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v2/agents/{agentId}/conversations/export"
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/export', 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/export",
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/export"
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/export")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v2/agents/{agentId}/conversations/export")
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",
"status": "ongoing",
"messages": [
{
"id": "<string>",
"role": "user",
"parts": [
{
"type": "text",
"text": "<string>"
}
],
"createdAt": 123,
"feedback": "positive",
"metadata": {
"score": 123
}
}
]
}
],
"pagination": {
"cursor": "<string>",
"hasMore": true,
"total": 123
}
}Authorizations
API key from your account settings
Path Parameters
The agent ID
1"5QHA6VB-DIAbBhxwqxfdi"
Query Parameters
Opaque cursor from a previous response to fetch the next page
"eyJ0IjoiMjAyNC0wMS0xNVQxMDozMDowMC4wMDBaIiwiaWQiOiJhYmMxMjMifQ=="
Number of items per page (1–20, default 20)
1 <= x <= 2020
Only return conversations created at or after this point. Accepts a calendar date (YYYY-MM-DD, interpreted as the start of that day in UTC) or an ISO 8601 date-time.
"2024-01-01"
Only return conversations created at or before this point. Accepts a calendar date (YYYY-MM-DD, interpreted as the end of that day in UTC, so the day itself is included) or an ISO 8601 date-time.
"2024-01-31"
Return only the conversation with this ID. Use this to fetch a single conversation from any source (widget, API, WhatsApp, etc.).
Whether to include message bodies. summary omits them and skips reading them from the database — use it to triage a page cheaply, then re-request a specific conversation with conversationId. Defaults to messages.
summary, messages "summary"
Comma-separated conversation sources to include, e.g. API,WhatsApp. Omit for all sources.
"Widget or Iframe"
