Get a specific contact
curl --request GET \
--url https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts/{contactId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts/{contactId}"
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/{contactId}', 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/{contactId}",
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/{contactId}"
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/{contactId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts/{contactId}")
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
}
}{
"message": "No API key provided."
}{
"message": "Resource not found"
}{
"message": "Rate limit exceeded. Please try again later."
}{
"message": "Internal server error"
}Contacts
Get a specific contact
Retrieves a single contact by ID
GET
/
chatbots
/
{chatbotId}
/
contacts
/
{contactId}
Get a specific contact
curl --request GET \
--url https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts/{contactId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts/{contactId}"
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/{contactId}', 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/{contactId}",
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/{contactId}"
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/{contactId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts/{contactId}")
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
}
}{
"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
External ID or internal ID of the contact. If both match different contacts, the external ID match wins.