Get contacts for a chatbot
curl --request GET \
--url https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts"
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/v1/chatbots/{chatbotId}/contacts', 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/v1/chatbots/{chatbotId}/contacts",
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/v1/chatbots/{chatbotId}/contacts"
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/v1/chatbots/{chatbotId}/contacts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts")
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{
"message": "Success",
"data": [
{
"id": "contact_internal_123",
"external_id": "user_123",
"name": "John Doe",
"email": "john@example.com",
"phonenumber": "+1234567890",
"stripe_accounts": [
{
"label": "main",
"stripe_id": "cus_123abc456",
"stripe_email": "john@example.com"
}
],
"custom_attributes": {
"department": "Sales",
"subscription_tier": "Premium"
},
"created_at": 1704067200,
"updated_at": 1704153600
}
],
"total": 250,
"pages": {
"page": 1,
"per_page": 100,
"total_pages": 3
}
}{
"message": "Invalid request data"
}{
"message": "No API key provided."
}{
"message": "Resource not found"
}{
"message": "Rate limit exceeded. Please try again later."
}{
"message": "Internal server error"
}Contacts
Get contacts for a chatbot
Retrieves paginated list of contacts for a specific chatbot
GET
/
chatbots
/
{chatbotId}
/
contacts
Get contacts for a chatbot
curl --request GET \
--url https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts"
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/v1/chatbots/{chatbotId}/contacts', 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/v1/chatbots/{chatbotId}/contacts",
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/v1/chatbots/{chatbotId}/contacts"
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/v1/chatbots/{chatbotId}/contacts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts")
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{
"message": "Success",
"data": [
{
"id": "contact_internal_123",
"external_id": "user_123",
"name": "John Doe",
"email": "john@example.com",
"phonenumber": "+1234567890",
"stripe_accounts": [
{
"label": "main",
"stripe_id": "cus_123abc456",
"stripe_email": "john@example.com"
}
],
"custom_attributes": {
"department": "Sales",
"subscription_tier": "Premium"
},
"created_at": 1704067200,
"updated_at": 1704153600
}
],
"total": 250,
"pages": {
"page": 1,
"per_page": 100,
"total_pages": 3
}
}{
"message": "Invalid request data"
}{
"message": "No API key provided."
}{
"message": "Resource not found"
}{
"message": "Rate limit exceeded. Please try again later."
}{
"message": "Internal server error"
}Authorizations
API key in Bearer token format
Path Parameters
ID of the chatbot
Query Parameters
Number of contacts per page (10-1000)
Required range:
10 <= x <= 1000Page number (starts from 1)
Required range:
x >= 1⌘I