Get a contact
curl --request GET \
--url http://localhost:8080/contacts/{contact_id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/contacts/{contact_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/contacts/{contact_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/contacts/{contact_id}",
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 := "http://localhost:8080/contacts/{contact_id}"
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("http://localhost:8080/contacts/{contact_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/contacts/{contact_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"primary_external_id": "<string>",
"email": "jsmith@example.com",
"phone_number": "<string>",
"name": "<string>",
"custom_data": {},
"non_verified_custom_data": {},
"created_at": "<string>",
"updated_at": "<string>",
"restricted_channels": [
"email"
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Contacts
Get a contact
Get a single contact by its ID. Use when your application already holds a contact ID and needs that contact’s details and custom data.
GET
/
contacts
/
{contact_id}
Get a contact
curl --request GET \
--url http://localhost:8080/contacts/{contact_id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/contacts/{contact_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/contacts/{contact_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/contacts/{contact_id}",
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 := "http://localhost:8080/contacts/{contact_id}"
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("http://localhost:8080/contacts/{contact_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/contacts/{contact_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"primary_external_id": "<string>",
"email": "jsmith@example.com",
"phone_number": "<string>",
"name": "<string>",
"custom_data": {},
"non_verified_custom_data": {},
"created_at": "<string>",
"updated_at": "<string>",
"restricted_channels": [
"email"
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}external_id contains the contact’s ID in your system, or null when the contact was not identified by external ID. primary_external_id contains the main account’s external ID, or null when the contact has no main account reference. The referenced contact may not exist yet. Both are set through Authenticate contact by external ID or the contact create and update endpoints; agents can view connected contact history in the dashboard, subject to their session permissions. Each contact retains its own sessions and customer access.
restricted_channels lists the channels the contact asked not to be contacted on, or is empty. Change it with Set restricted channels; see restricted channels for what a restriction stops.Authorizations
Path Parameters
Response
Default Response
Channels this contact asked not to be contacted on: any of email, sms, whatsapp, phone_voice. Nothing your team, workflows, sequences or the API start goes out to the contact on a listed channel; AI replies to the contact's messages and your team's replies in a session on that channel are still delivered. Empty when nothing is restricted.
Available options:
email, sms, whatsapp, phone_voice Was this page helpful?