curl --request POST \
--url https://api.text.com/cdp/v1/create_customers \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"updated_at": "2026-09-01T10:00:00Z",
"customers": [
{
"name": "Thomas Anderson",
"email": "t.anderson@example.com",
"phone_number": "+15550000001",
"address": {
"address": "1600 Pennsylvania Avenue NW",
"city": "Washington",
"country": "United States",
"state": "DC",
"postal_code": "20500"
},
"relationship_level": "vip",
"properties": {
"9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11": 42
},
"omnichannel": {
"fbmessenger": {
"id": "4f0ad8d8-1b7e-4519-8400-fa955eb11d12",
"name": "Thomas Anderson",
"first_name": "Thomas",
"last_name": "Anderson",
"profile_pic": "https://example.com/avatars/facebook.png",
"gender": "male",
"locale": "en-US",
"is_verified_user": true
},
"twilio": {
"phone_number": "+15550000001"
},
"whatsapp": {
"id": "15550000001",
"name": "Thomas Anderson",
"phone_number": "+15550000001"
},
"instagram": {
"ig_user_id": "17841405793187218",
"username": "thomas.anderson",
"name": "Thomas Anderson",
"profile_pic": "https://example.com/avatars/instagram.png",
"follower_count": 120,
"is_verified_user": true,
"is_user_follow_business": true,
"is_business_follow_user": false
},
"telegram": {
"telegram_user_id": 123456789,
"first_name": "Thomas",
"last_name": "Anderson",
"username": "thomas_anderson",
"language_code": "en",
"display_name": "Thomas Anderson",
"is_premium": true
},
"sms": {
"phone_number": "+15550000002"
}
}
},
{
"email": "trinity@example.com"
}
]
}
'import requests
url = "https://api.text.com/cdp/v1/create_customers"
payload = {
"updated_at": "2026-09-01T10:00:00Z",
"customers": [{
"name": "Thomas Anderson",
"email": "t.anderson@example.com",
"phone_number": "+15550000001",
"address": {
"address": "1600 Pennsylvania Avenue NW",
"city": "Washington",
"country": "United States",
"state": "DC",
"postal_code": "20500"
},
"relationship_level": "vip",
"properties": { "9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11": 42 },
"omnichannel": {
"fbmessenger": {
"id": "4f0ad8d8-1b7e-4519-8400-fa955eb11d12",
"name": "Thomas Anderson",
"first_name": "Thomas",
"last_name": "Anderson",
"profile_pic": "https://example.com/avatars/facebook.png",
"gender": "male",
"locale": "en-US",
"is_verified_user": True
},
"twilio": { "phone_number": "+15550000001" },
"whatsapp": {
"id": "15550000001",
"name": "Thomas Anderson",
"phone_number": "+15550000001"
},
"instagram": {
"ig_user_id": "17841405793187218",
"username": "thomas.anderson",
"name": "Thomas Anderson",
"profile_pic": "https://example.com/avatars/instagram.png",
"follower_count": 120,
"is_verified_user": True,
"is_user_follow_business": True,
"is_business_follow_user": False
},
"telegram": {
"telegram_user_id": 123456789,
"first_name": "Thomas",
"last_name": "Anderson",
"username": "thomas_anderson",
"language_code": "en",
"display_name": "Thomas Anderson",
"is_premium": True
},
"sms": { "phone_number": "+15550000002" }
}
}, { "email": "trinity@example.com" }]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
updated_at: '2026-09-01T10:00:00Z',
customers: [
{
name: 'Thomas Anderson',
email: 't.anderson@example.com',
phone_number: '+15550000001',
address: {
address: '1600 Pennsylvania Avenue NW',
city: 'Washington',
country: 'United States',
state: 'DC',
postal_code: '20500'
},
relationship_level: 'vip',
properties: {'9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11': 42},
omnichannel: {
fbmessenger: {
id: '4f0ad8d8-1b7e-4519-8400-fa955eb11d12',
name: 'Thomas Anderson',
first_name: 'Thomas',
last_name: 'Anderson',
profile_pic: 'https://example.com/avatars/facebook.png',
gender: 'male',
locale: 'en-US',
is_verified_user: true
},
twilio: {phone_number: '+15550000001'},
whatsapp: {id: '15550000001', name: 'Thomas Anderson', phone_number: '+15550000001'},
instagram: {
ig_user_id: '17841405793187218',
username: 'thomas.anderson',
name: 'Thomas Anderson',
profile_pic: 'https://example.com/avatars/instagram.png',
follower_count: 120,
is_verified_user: true,
is_user_follow_business: true,
is_business_follow_user: false
},
telegram: {
telegram_user_id: 123456789,
first_name: 'Thomas',
last_name: 'Anderson',
username: 'thomas_anderson',
language_code: 'en',
display_name: 'Thomas Anderson',
is_premium: true
},
sms: {phone_number: '+15550000002'}
}
},
{email: 'trinity@example.com'}
]
})
};
fetch('https://api.text.com/cdp/v1/create_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://api.text.com/cdp/v1/create_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([
'updated_at' => '2026-09-01T10:00:00Z',
'customers' => [
[
'name' => 'Thomas Anderson',
'email' => 't.anderson@example.com',
'phone_number' => '+15550000001',
'address' => [
'address' => '1600 Pennsylvania Avenue NW',
'city' => 'Washington',
'country' => 'United States',
'state' => 'DC',
'postal_code' => '20500'
],
'relationship_level' => 'vip',
'properties' => [
'9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11' => 42
],
'omnichannel' => [
'fbmessenger' => [
'id' => '4f0ad8d8-1b7e-4519-8400-fa955eb11d12',
'name' => 'Thomas Anderson',
'first_name' => 'Thomas',
'last_name' => 'Anderson',
'profile_pic' => 'https://example.com/avatars/facebook.png',
'gender' => 'male',
'locale' => 'en-US',
'is_verified_user' => true
],
'twilio' => [
'phone_number' => '+15550000001'
],
'whatsapp' => [
'id' => '15550000001',
'name' => 'Thomas Anderson',
'phone_number' => '+15550000001'
],
'instagram' => [
'ig_user_id' => '17841405793187218',
'username' => 'thomas.anderson',
'name' => 'Thomas Anderson',
'profile_pic' => 'https://example.com/avatars/instagram.png',
'follower_count' => 120,
'is_verified_user' => true,
'is_user_follow_business' => true,
'is_business_follow_user' => false
],
'telegram' => [
'telegram_user_id' => 123456789,
'first_name' => 'Thomas',
'last_name' => 'Anderson',
'username' => 'thomas_anderson',
'language_code' => 'en',
'display_name' => 'Thomas Anderson',
'is_premium' => true
],
'sms' => [
'phone_number' => '+15550000002'
]
]
],
[
'email' => 'trinity@example.com'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.text.com/cdp/v1/create_customers"
payload := strings.NewReader("{\n \"updated_at\": \"2026-09-01T10:00:00Z\",\n \"customers\": [\n {\n \"name\": \"Thomas Anderson\",\n \"email\": \"t.anderson@example.com\",\n \"phone_number\": \"+15550000001\",\n \"address\": {\n \"address\": \"1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington\",\n \"country\": \"United States\",\n \"state\": \"DC\",\n \"postal_code\": \"20500\"\n },\n \"relationship_level\": \"vip\",\n \"properties\": {\n \"9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11\": 42\n },\n \"omnichannel\": {\n \"fbmessenger\": {\n \"id\": \"4f0ad8d8-1b7e-4519-8400-fa955eb11d12\",\n \"name\": \"Thomas Anderson\",\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"profile_pic\": \"https://example.com/avatars/facebook.png\",\n \"gender\": \"male\",\n \"locale\": \"en-US\",\n \"is_verified_user\": true\n },\n \"twilio\": {\n \"phone_number\": \"+15550000001\"\n },\n \"whatsapp\": {\n \"id\": \"15550000001\",\n \"name\": \"Thomas Anderson\",\n \"phone_number\": \"+15550000001\"\n },\n \"instagram\": {\n \"ig_user_id\": \"17841405793187218\",\n \"username\": \"thomas.anderson\",\n \"name\": \"Thomas Anderson\",\n \"profile_pic\": \"https://example.com/avatars/instagram.png\",\n \"follower_count\": 120,\n \"is_verified_user\": true,\n \"is_user_follow_business\": true,\n \"is_business_follow_user\": false\n },\n \"telegram\": {\n \"telegram_user_id\": 123456789,\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"username\": \"thomas_anderson\",\n \"language_code\": \"en\",\n \"display_name\": \"Thomas Anderson\",\n \"is_premium\": true\n },\n \"sms\": {\n \"phone_number\": \"+15550000002\"\n }\n }\n },\n {\n \"email\": \"trinity@example.com\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.text.com/cdp/v1/create_customers")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"updated_at\": \"2026-09-01T10:00:00Z\",\n \"customers\": [\n {\n \"name\": \"Thomas Anderson\",\n \"email\": \"t.anderson@example.com\",\n \"phone_number\": \"+15550000001\",\n \"address\": {\n \"address\": \"1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington\",\n \"country\": \"United States\",\n \"state\": \"DC\",\n \"postal_code\": \"20500\"\n },\n \"relationship_level\": \"vip\",\n \"properties\": {\n \"9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11\": 42\n },\n \"omnichannel\": {\n \"fbmessenger\": {\n \"id\": \"4f0ad8d8-1b7e-4519-8400-fa955eb11d12\",\n \"name\": \"Thomas Anderson\",\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"profile_pic\": \"https://example.com/avatars/facebook.png\",\n \"gender\": \"male\",\n \"locale\": \"en-US\",\n \"is_verified_user\": true\n },\n \"twilio\": {\n \"phone_number\": \"+15550000001\"\n },\n \"whatsapp\": {\n \"id\": \"15550000001\",\n \"name\": \"Thomas Anderson\",\n \"phone_number\": \"+15550000001\"\n },\n \"instagram\": {\n \"ig_user_id\": \"17841405793187218\",\n \"username\": \"thomas.anderson\",\n \"name\": \"Thomas Anderson\",\n \"profile_pic\": \"https://example.com/avatars/instagram.png\",\n \"follower_count\": 120,\n \"is_verified_user\": true,\n \"is_user_follow_business\": true,\n \"is_business_follow_user\": false\n },\n \"telegram\": {\n \"telegram_user_id\": 123456789,\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"username\": \"thomas_anderson\",\n \"language_code\": \"en\",\n \"display_name\": \"Thomas Anderson\",\n \"is_premium\": true\n },\n \"sms\": {\n \"phone_number\": \"+15550000002\"\n }\n }\n },\n {\n \"email\": \"trinity@example.com\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.text.com/cdp/v1/create_customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"updated_at\": \"2026-09-01T10:00:00Z\",\n \"customers\": [\n {\n \"name\": \"Thomas Anderson\",\n \"email\": \"t.anderson@example.com\",\n \"phone_number\": \"+15550000001\",\n \"address\": {\n \"address\": \"1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington\",\n \"country\": \"United States\",\n \"state\": \"DC\",\n \"postal_code\": \"20500\"\n },\n \"relationship_level\": \"vip\",\n \"properties\": {\n \"9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11\": 42\n },\n \"omnichannel\": {\n \"fbmessenger\": {\n \"id\": \"4f0ad8d8-1b7e-4519-8400-fa955eb11d12\",\n \"name\": \"Thomas Anderson\",\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"profile_pic\": \"https://example.com/avatars/facebook.png\",\n \"gender\": \"male\",\n \"locale\": \"en-US\",\n \"is_verified_user\": true\n },\n \"twilio\": {\n \"phone_number\": \"+15550000001\"\n },\n \"whatsapp\": {\n \"id\": \"15550000001\",\n \"name\": \"Thomas Anderson\",\n \"phone_number\": \"+15550000001\"\n },\n \"instagram\": {\n \"ig_user_id\": \"17841405793187218\",\n \"username\": \"thomas.anderson\",\n \"name\": \"Thomas Anderson\",\n \"profile_pic\": \"https://example.com/avatars/instagram.png\",\n \"follower_count\": 120,\n \"is_verified_user\": true,\n \"is_user_follow_business\": true,\n \"is_business_follow_user\": false\n },\n \"telegram\": {\n \"telegram_user_id\": 123456789,\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"username\": \"thomas_anderson\",\n \"language_code\": \"en\",\n \"display_name\": \"Thomas Anderson\",\n \"is_premium\": true\n },\n \"sms\": {\n \"phone_number\": \"+15550000002\"\n }\n }\n },\n {\n \"email\": \"trinity@example.com\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"customer_id": "cf89fa3a-5ee9-4bdb-84ec-38824b2e2786"
},
{
"error": {
"type": "internal",
"message": "Failed to create the customer."
}
}
]
}Create customers
Creates up to 100 customers in one request. Each item creates a customer without matching it to another customer record.
The API validates the entire request before creating any customers. If any item fails validation, the entire request fails and no customers are created. After validation succeeds, the API processes each item independently and returns one result for each item in the request order. A creation error for one item does not prevent the other items from being created.
Customers that share an email address are merged. For more information, see Customer identities and merged customers.
curl --request POST \
--url https://api.text.com/cdp/v1/create_customers \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"updated_at": "2026-09-01T10:00:00Z",
"customers": [
{
"name": "Thomas Anderson",
"email": "t.anderson@example.com",
"phone_number": "+15550000001",
"address": {
"address": "1600 Pennsylvania Avenue NW",
"city": "Washington",
"country": "United States",
"state": "DC",
"postal_code": "20500"
},
"relationship_level": "vip",
"properties": {
"9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11": 42
},
"omnichannel": {
"fbmessenger": {
"id": "4f0ad8d8-1b7e-4519-8400-fa955eb11d12",
"name": "Thomas Anderson",
"first_name": "Thomas",
"last_name": "Anderson",
"profile_pic": "https://example.com/avatars/facebook.png",
"gender": "male",
"locale": "en-US",
"is_verified_user": true
},
"twilio": {
"phone_number": "+15550000001"
},
"whatsapp": {
"id": "15550000001",
"name": "Thomas Anderson",
"phone_number": "+15550000001"
},
"instagram": {
"ig_user_id": "17841405793187218",
"username": "thomas.anderson",
"name": "Thomas Anderson",
"profile_pic": "https://example.com/avatars/instagram.png",
"follower_count": 120,
"is_verified_user": true,
"is_user_follow_business": true,
"is_business_follow_user": false
},
"telegram": {
"telegram_user_id": 123456789,
"first_name": "Thomas",
"last_name": "Anderson",
"username": "thomas_anderson",
"language_code": "en",
"display_name": "Thomas Anderson",
"is_premium": true
},
"sms": {
"phone_number": "+15550000002"
}
}
},
{
"email": "trinity@example.com"
}
]
}
'import requests
url = "https://api.text.com/cdp/v1/create_customers"
payload = {
"updated_at": "2026-09-01T10:00:00Z",
"customers": [{
"name": "Thomas Anderson",
"email": "t.anderson@example.com",
"phone_number": "+15550000001",
"address": {
"address": "1600 Pennsylvania Avenue NW",
"city": "Washington",
"country": "United States",
"state": "DC",
"postal_code": "20500"
},
"relationship_level": "vip",
"properties": { "9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11": 42 },
"omnichannel": {
"fbmessenger": {
"id": "4f0ad8d8-1b7e-4519-8400-fa955eb11d12",
"name": "Thomas Anderson",
"first_name": "Thomas",
"last_name": "Anderson",
"profile_pic": "https://example.com/avatars/facebook.png",
"gender": "male",
"locale": "en-US",
"is_verified_user": True
},
"twilio": { "phone_number": "+15550000001" },
"whatsapp": {
"id": "15550000001",
"name": "Thomas Anderson",
"phone_number": "+15550000001"
},
"instagram": {
"ig_user_id": "17841405793187218",
"username": "thomas.anderson",
"name": "Thomas Anderson",
"profile_pic": "https://example.com/avatars/instagram.png",
"follower_count": 120,
"is_verified_user": True,
"is_user_follow_business": True,
"is_business_follow_user": False
},
"telegram": {
"telegram_user_id": 123456789,
"first_name": "Thomas",
"last_name": "Anderson",
"username": "thomas_anderson",
"language_code": "en",
"display_name": "Thomas Anderson",
"is_premium": True
},
"sms": { "phone_number": "+15550000002" }
}
}, { "email": "trinity@example.com" }]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
updated_at: '2026-09-01T10:00:00Z',
customers: [
{
name: 'Thomas Anderson',
email: 't.anderson@example.com',
phone_number: '+15550000001',
address: {
address: '1600 Pennsylvania Avenue NW',
city: 'Washington',
country: 'United States',
state: 'DC',
postal_code: '20500'
},
relationship_level: 'vip',
properties: {'9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11': 42},
omnichannel: {
fbmessenger: {
id: '4f0ad8d8-1b7e-4519-8400-fa955eb11d12',
name: 'Thomas Anderson',
first_name: 'Thomas',
last_name: 'Anderson',
profile_pic: 'https://example.com/avatars/facebook.png',
gender: 'male',
locale: 'en-US',
is_verified_user: true
},
twilio: {phone_number: '+15550000001'},
whatsapp: {id: '15550000001', name: 'Thomas Anderson', phone_number: '+15550000001'},
instagram: {
ig_user_id: '17841405793187218',
username: 'thomas.anderson',
name: 'Thomas Anderson',
profile_pic: 'https://example.com/avatars/instagram.png',
follower_count: 120,
is_verified_user: true,
is_user_follow_business: true,
is_business_follow_user: false
},
telegram: {
telegram_user_id: 123456789,
first_name: 'Thomas',
last_name: 'Anderson',
username: 'thomas_anderson',
language_code: 'en',
display_name: 'Thomas Anderson',
is_premium: true
},
sms: {phone_number: '+15550000002'}
}
},
{email: 'trinity@example.com'}
]
})
};
fetch('https://api.text.com/cdp/v1/create_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://api.text.com/cdp/v1/create_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([
'updated_at' => '2026-09-01T10:00:00Z',
'customers' => [
[
'name' => 'Thomas Anderson',
'email' => 't.anderson@example.com',
'phone_number' => '+15550000001',
'address' => [
'address' => '1600 Pennsylvania Avenue NW',
'city' => 'Washington',
'country' => 'United States',
'state' => 'DC',
'postal_code' => '20500'
],
'relationship_level' => 'vip',
'properties' => [
'9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11' => 42
],
'omnichannel' => [
'fbmessenger' => [
'id' => '4f0ad8d8-1b7e-4519-8400-fa955eb11d12',
'name' => 'Thomas Anderson',
'first_name' => 'Thomas',
'last_name' => 'Anderson',
'profile_pic' => 'https://example.com/avatars/facebook.png',
'gender' => 'male',
'locale' => 'en-US',
'is_verified_user' => true
],
'twilio' => [
'phone_number' => '+15550000001'
],
'whatsapp' => [
'id' => '15550000001',
'name' => 'Thomas Anderson',
'phone_number' => '+15550000001'
],
'instagram' => [
'ig_user_id' => '17841405793187218',
'username' => 'thomas.anderson',
'name' => 'Thomas Anderson',
'profile_pic' => 'https://example.com/avatars/instagram.png',
'follower_count' => 120,
'is_verified_user' => true,
'is_user_follow_business' => true,
'is_business_follow_user' => false
],
'telegram' => [
'telegram_user_id' => 123456789,
'first_name' => 'Thomas',
'last_name' => 'Anderson',
'username' => 'thomas_anderson',
'language_code' => 'en',
'display_name' => 'Thomas Anderson',
'is_premium' => true
],
'sms' => [
'phone_number' => '+15550000002'
]
]
],
[
'email' => 'trinity@example.com'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.text.com/cdp/v1/create_customers"
payload := strings.NewReader("{\n \"updated_at\": \"2026-09-01T10:00:00Z\",\n \"customers\": [\n {\n \"name\": \"Thomas Anderson\",\n \"email\": \"t.anderson@example.com\",\n \"phone_number\": \"+15550000001\",\n \"address\": {\n \"address\": \"1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington\",\n \"country\": \"United States\",\n \"state\": \"DC\",\n \"postal_code\": \"20500\"\n },\n \"relationship_level\": \"vip\",\n \"properties\": {\n \"9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11\": 42\n },\n \"omnichannel\": {\n \"fbmessenger\": {\n \"id\": \"4f0ad8d8-1b7e-4519-8400-fa955eb11d12\",\n \"name\": \"Thomas Anderson\",\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"profile_pic\": \"https://example.com/avatars/facebook.png\",\n \"gender\": \"male\",\n \"locale\": \"en-US\",\n \"is_verified_user\": true\n },\n \"twilio\": {\n \"phone_number\": \"+15550000001\"\n },\n \"whatsapp\": {\n \"id\": \"15550000001\",\n \"name\": \"Thomas Anderson\",\n \"phone_number\": \"+15550000001\"\n },\n \"instagram\": {\n \"ig_user_id\": \"17841405793187218\",\n \"username\": \"thomas.anderson\",\n \"name\": \"Thomas Anderson\",\n \"profile_pic\": \"https://example.com/avatars/instagram.png\",\n \"follower_count\": 120,\n \"is_verified_user\": true,\n \"is_user_follow_business\": true,\n \"is_business_follow_user\": false\n },\n \"telegram\": {\n \"telegram_user_id\": 123456789,\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"username\": \"thomas_anderson\",\n \"language_code\": \"en\",\n \"display_name\": \"Thomas Anderson\",\n \"is_premium\": true\n },\n \"sms\": {\n \"phone_number\": \"+15550000002\"\n }\n }\n },\n {\n \"email\": \"trinity@example.com\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.text.com/cdp/v1/create_customers")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"updated_at\": \"2026-09-01T10:00:00Z\",\n \"customers\": [\n {\n \"name\": \"Thomas Anderson\",\n \"email\": \"t.anderson@example.com\",\n \"phone_number\": \"+15550000001\",\n \"address\": {\n \"address\": \"1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington\",\n \"country\": \"United States\",\n \"state\": \"DC\",\n \"postal_code\": \"20500\"\n },\n \"relationship_level\": \"vip\",\n \"properties\": {\n \"9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11\": 42\n },\n \"omnichannel\": {\n \"fbmessenger\": {\n \"id\": \"4f0ad8d8-1b7e-4519-8400-fa955eb11d12\",\n \"name\": \"Thomas Anderson\",\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"profile_pic\": \"https://example.com/avatars/facebook.png\",\n \"gender\": \"male\",\n \"locale\": \"en-US\",\n \"is_verified_user\": true\n },\n \"twilio\": {\n \"phone_number\": \"+15550000001\"\n },\n \"whatsapp\": {\n \"id\": \"15550000001\",\n \"name\": \"Thomas Anderson\",\n \"phone_number\": \"+15550000001\"\n },\n \"instagram\": {\n \"ig_user_id\": \"17841405793187218\",\n \"username\": \"thomas.anderson\",\n \"name\": \"Thomas Anderson\",\n \"profile_pic\": \"https://example.com/avatars/instagram.png\",\n \"follower_count\": 120,\n \"is_verified_user\": true,\n \"is_user_follow_business\": true,\n \"is_business_follow_user\": false\n },\n \"telegram\": {\n \"telegram_user_id\": 123456789,\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"username\": \"thomas_anderson\",\n \"language_code\": \"en\",\n \"display_name\": \"Thomas Anderson\",\n \"is_premium\": true\n },\n \"sms\": {\n \"phone_number\": \"+15550000002\"\n }\n }\n },\n {\n \"email\": \"trinity@example.com\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.text.com/cdp/v1/create_customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"updated_at\": \"2026-09-01T10:00:00Z\",\n \"customers\": [\n {\n \"name\": \"Thomas Anderson\",\n \"email\": \"t.anderson@example.com\",\n \"phone_number\": \"+15550000001\",\n \"address\": {\n \"address\": \"1600 Pennsylvania Avenue NW\",\n \"city\": \"Washington\",\n \"country\": \"United States\",\n \"state\": \"DC\",\n \"postal_code\": \"20500\"\n },\n \"relationship_level\": \"vip\",\n \"properties\": {\n \"9b1c9e0a-3a4b-4f0e-9b6f-1f6c8a2b0d11\": 42\n },\n \"omnichannel\": {\n \"fbmessenger\": {\n \"id\": \"4f0ad8d8-1b7e-4519-8400-fa955eb11d12\",\n \"name\": \"Thomas Anderson\",\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"profile_pic\": \"https://example.com/avatars/facebook.png\",\n \"gender\": \"male\",\n \"locale\": \"en-US\",\n \"is_verified_user\": true\n },\n \"twilio\": {\n \"phone_number\": \"+15550000001\"\n },\n \"whatsapp\": {\n \"id\": \"15550000001\",\n \"name\": \"Thomas Anderson\",\n \"phone_number\": \"+15550000001\"\n },\n \"instagram\": {\n \"ig_user_id\": \"17841405793187218\",\n \"username\": \"thomas.anderson\",\n \"name\": \"Thomas Anderson\",\n \"profile_pic\": \"https://example.com/avatars/instagram.png\",\n \"follower_count\": 120,\n \"is_verified_user\": true,\n \"is_user_follow_business\": true,\n \"is_business_follow_user\": false\n },\n \"telegram\": {\n \"telegram_user_id\": 123456789,\n \"first_name\": \"Thomas\",\n \"last_name\": \"Anderson\",\n \"username\": \"thomas_anderson\",\n \"language_code\": \"en\",\n \"display_name\": \"Thomas Anderson\",\n \"is_premium\": true\n },\n \"sms\": {\n \"phone_number\": \"+15550000002\"\n }\n }\n },\n {\n \"email\": \"trinity@example.com\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"customer_id": "cf89fa3a-5ee9-4bdb-84ec-38824b2e2786"
},
{
"error": {
"type": "internal",
"message": "Failed to create the customer."
}
}
]
}customers:rwAuthorizations
Use your account ID as the username and your personal access token (PAT) as the password, or pass a Base64-encoded value directly in the Authorization header. For more information, see the personal access tokens guide.
Body
Was this page helpful?