curl --request POST \
--url https://{tenant_domain}/third-party/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "whatsapp",
"display_id": 491521234567,
"name": "<string>"
}
'import requests
url = "https://{tenant_domain}/third-party/v1/customers"
payload = {
"channel": "whatsapp",
"display_id": 491521234567,
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({channel: 'whatsapp', display_id: 491521234567, name: '<string>'})
};
fetch('https://{tenant_domain}/third-party/v1/customers', 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://{tenant_domain}/third-party/v1/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel' => 'whatsapp',
'display_id' => 491521234567,
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant_domain}/third-party/v1/customers"
payload := strings.NewReader("{\n \"channel\": \"whatsapp\",\n \"display_id\": 491521234567,\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenant_domain}/third-party/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"whatsapp\",\n \"display_id\": 491521234567,\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant_domain}/third-party/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel\": \"whatsapp\",\n \"display_id\": 491521234567,\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"channel": "bridge",
"display_id": 4915223567929,
"canonical_id": "DE.abc123",
"name": "John Doe",
"username": "john_doe",
"profile": {
"id": 123,
"salutation": "formal_male",
"name": "John Doe",
"gender": "undisclosed",
"blocked": true,
"date_of_birth": "1970-01-01",
"phone_number": "+4915224367929",
"email": "jsmith@example.com",
"address": "<string>",
"custom_1": "<string>",
"custom_2": "<string>",
"custom_3": "<string>",
"custom_4": "<string>",
"custom_5": "<string>",
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-01-01T12:00:00Z"
},
"conversations": [
{
"id": 123
}
]
}Add a new customer. Also creates a new profile.
Currently only possible for channel WhatsApp.
curl --request POST \
--url https://{tenant_domain}/third-party/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "whatsapp",
"display_id": 491521234567,
"name": "<string>"
}
'import requests
url = "https://{tenant_domain}/third-party/v1/customers"
payload = {
"channel": "whatsapp",
"display_id": 491521234567,
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({channel: 'whatsapp', display_id: 491521234567, name: '<string>'})
};
fetch('https://{tenant_domain}/third-party/v1/customers', 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://{tenant_domain}/third-party/v1/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel' => 'whatsapp',
'display_id' => 491521234567,
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant_domain}/third-party/v1/customers"
payload := strings.NewReader("{\n \"channel\": \"whatsapp\",\n \"display_id\": 491521234567,\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenant_domain}/third-party/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"whatsapp\",\n \"display_id\": 491521234567,\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant_domain}/third-party/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel\": \"whatsapp\",\n \"display_id\": 491521234567,\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"channel": "bridge",
"display_id": 4915223567929,
"canonical_id": "DE.abc123",
"name": "John Doe",
"username": "john_doe",
"profile": {
"id": 123,
"salutation": "formal_male",
"name": "John Doe",
"gender": "undisclosed",
"blocked": true,
"date_of_birth": "1970-01-01",
"phone_number": "+4915224367929",
"email": "jsmith@example.com",
"address": "<string>",
"custom_1": "<string>",
"custom_2": "<string>",
"custom_3": "<string>",
"custom_4": "<string>",
"custom_5": "<string>",
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-01-01T12:00:00Z"
},
"conversations": [
{
"id": 123
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
whatsapp For WhatsApp: phone number in international format without leading "+", special characters and spaces. Must be unique among channel "whatsapp". Will be saved as phone number in profile.
491521234567
Name of customer and profile.
Response
Success
Represents a customer using a messenger service. A person with a phone number registered on WhatsApp is a customer.
Type of messenger service.
bridge, whatsapp, facebook, widget An unique identifier within a channel.
4915223567929
Additional ID that identifies the customer. Currently used for WhatsApp. In WhatsApp, the display_id is either the phone number or the username. The canonical_id is always the BSUID (see WhatsApp usernames documentation). For other channels, the canonical_id is not used.
"DE.abc123"
Name received from channel.
"John Doe"
Self given username. See WhatsApp usernames.
"john_doe"
Profile data of a customer, without the nested list of other customers on the same profile. Used when embedding a profile inside a customer, to avoid re-embedding the customer itself.
Show child attributes
Show child attributes
Not always included.
Show child attributes
Show child attributes