Classify campaign contacts for the Review step
curl --request POST \
--url https://your-instance.example.com/api/campaigns/validate-contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"firstName": "Jamie",
"phoneNumber": "+14155550133"
},
{
"firstName": "Casey",
"phoneNumber": "+14155550144"
}
],
"segmentationConfig": {
"enabled": false
},
"assignmentConfig": {
"isAssignmentEnabled": false
}
}
'import requests
url = "https://your-instance.example.com/api/campaigns/validate-contacts"
payload = {
"contacts": [
{
"firstName": "Jamie",
"phoneNumber": "+14155550133"
},
{
"firstName": "Casey",
"phoneNumber": "+14155550144"
}
],
"segmentationConfig": { "enabled": False },
"assignmentConfig": { "isAssignmentEnabled": False }
}
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({
contacts: [
{firstName: 'Jamie', phoneNumber: '+14155550133'},
{firstName: 'Casey', phoneNumber: '+14155550144'}
],
segmentationConfig: {enabled: false},
assignmentConfig: {isAssignmentEnabled: false}
})
};
fetch('https://your-instance.example.com/api/campaigns/validate-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://your-instance.example.com/api/campaigns/validate-contacts",
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([
'contacts' => [
[
'firstName' => 'Jamie',
'phoneNumber' => '+14155550133'
],
[
'firstName' => 'Casey',
'phoneNumber' => '+14155550144'
]
],
'segmentationConfig' => [
'enabled' => false
],
'assignmentConfig' => [
'isAssignmentEnabled' => false
]
]),
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://your-instance.example.com/api/campaigns/validate-contacts"
payload := strings.NewReader("{\n \"contacts\": [\n {\n \"firstName\": \"Jamie\",\n \"phoneNumber\": \"+14155550133\"\n },\n {\n \"firstName\": \"Casey\",\n \"phoneNumber\": \"+14155550144\"\n }\n ],\n \"segmentationConfig\": {\n \"enabled\": false\n },\n \"assignmentConfig\": {\n \"isAssignmentEnabled\": false\n }\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://your-instance.example.com/api/campaigns/validate-contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contacts\": [\n {\n \"firstName\": \"Jamie\",\n \"phoneNumber\": \"+14155550133\"\n },\n {\n \"firstName\": \"Casey\",\n \"phoneNumber\": \"+14155550144\"\n }\n ],\n \"segmentationConfig\": {\n \"enabled\": false\n },\n \"assignmentConfig\": {\n \"isAssignmentEnabled\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/campaigns/validate-contacts")
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 \"contacts\": [\n {\n \"firstName\": \"Jamie\",\n \"phoneNumber\": \"+14155550133\"\n },\n {\n \"firstName\": \"Casey\",\n \"phoneNumber\": \"+14155550144\"\n }\n ],\n \"segmentationConfig\": {\n \"enabled\": false\n },\n \"assignmentConfig\": {\n \"isAssignmentEnabled\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"newContacts": [
{
"firstName": "Jamie",
"phoneNumber": "+14155550133"
}
],
"existingContacts": [],
"assignedToOtherUsers": [],
"alreadyMessagedOutbound": [],
"alreadyMessagedInbound": [],
"assignedToYouNotOwned": [],
"protectedContacts": []
}
}{
"success": false,
"message": "Validation error",
"error": "name is required"
}{
"success": false,
"message": "Validation error",
"error": "name is required"
}Campaigns
Classify campaign contacts for the Review step
Classifies the provided CSV/contact payload into buckets (new, existing, already-messaged inbound/outbound, assigned-to-other-user, protected, etc.) using the organization's contact protection period and the campaign's segmentation/assignment configuration. Returns { success, data: ContactValidationResult }.
POST
/
api
/
campaigns
/
validate-contacts
Classify campaign contacts for the Review step
curl --request POST \
--url https://your-instance.example.com/api/campaigns/validate-contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"firstName": "Jamie",
"phoneNumber": "+14155550133"
},
{
"firstName": "Casey",
"phoneNumber": "+14155550144"
}
],
"segmentationConfig": {
"enabled": false
},
"assignmentConfig": {
"isAssignmentEnabled": false
}
}
'import requests
url = "https://your-instance.example.com/api/campaigns/validate-contacts"
payload = {
"contacts": [
{
"firstName": "Jamie",
"phoneNumber": "+14155550133"
},
{
"firstName": "Casey",
"phoneNumber": "+14155550144"
}
],
"segmentationConfig": { "enabled": False },
"assignmentConfig": { "isAssignmentEnabled": False }
}
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({
contacts: [
{firstName: 'Jamie', phoneNumber: '+14155550133'},
{firstName: 'Casey', phoneNumber: '+14155550144'}
],
segmentationConfig: {enabled: false},
assignmentConfig: {isAssignmentEnabled: false}
})
};
fetch('https://your-instance.example.com/api/campaigns/validate-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://your-instance.example.com/api/campaigns/validate-contacts",
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([
'contacts' => [
[
'firstName' => 'Jamie',
'phoneNumber' => '+14155550133'
],
[
'firstName' => 'Casey',
'phoneNumber' => '+14155550144'
]
],
'segmentationConfig' => [
'enabled' => false
],
'assignmentConfig' => [
'isAssignmentEnabled' => false
]
]),
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://your-instance.example.com/api/campaigns/validate-contacts"
payload := strings.NewReader("{\n \"contacts\": [\n {\n \"firstName\": \"Jamie\",\n \"phoneNumber\": \"+14155550133\"\n },\n {\n \"firstName\": \"Casey\",\n \"phoneNumber\": \"+14155550144\"\n }\n ],\n \"segmentationConfig\": {\n \"enabled\": false\n },\n \"assignmentConfig\": {\n \"isAssignmentEnabled\": false\n }\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://your-instance.example.com/api/campaigns/validate-contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contacts\": [\n {\n \"firstName\": \"Jamie\",\n \"phoneNumber\": \"+14155550133\"\n },\n {\n \"firstName\": \"Casey\",\n \"phoneNumber\": \"+14155550144\"\n }\n ],\n \"segmentationConfig\": {\n \"enabled\": false\n },\n \"assignmentConfig\": {\n \"isAssignmentEnabled\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/campaigns/validate-contacts")
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 \"contacts\": [\n {\n \"firstName\": \"Jamie\",\n \"phoneNumber\": \"+14155550133\"\n },\n {\n \"firstName\": \"Casey\",\n \"phoneNumber\": \"+14155550144\"\n }\n ],\n \"segmentationConfig\": {\n \"enabled\": false\n },\n \"assignmentConfig\": {\n \"isAssignmentEnabled\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"newContacts": [
{
"firstName": "Jamie",
"phoneNumber": "+14155550133"
}
],
"existingContacts": [],
"assignedToOtherUsers": [],
"alreadyMessagedOutbound": [],
"alreadyMessagedInbound": [],
"assignedToYouNotOwned": [],
"protectedContacts": []
}
}{
"success": false,
"message": "Validation error",
"error": "name is required"
}{
"success": false,
"message": "Validation error",
"error": "name is required"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
CSV-derived contact payloads; each must include a phone number.
Optional segmentation config (enabled, contactDistribution, etc.).
Optional assignment config (isAssignmentEnabled, assignmentType, selectedUsers, segmentAssignments).
Response
Classification result returned
Available options:
true Buckets each input contact falls into based on phone matching, ownership, message history, assignee status, and the org's contact protection period.
Show child attributes
Show child attributes
Example:
{
"newContacts": [
{
"firstName": "Jamie",
"phoneNumber": "+14155550133"
}
],
"existingContacts": [
{
"_id": "665f1a0c0e0a4b001a2c9f01",
"phoneNumber": "+14155550144"
}
],
"assignedToOtherUsers": [],
"alreadyMessagedOutbound": [],
"alreadyMessagedInbound": [],
"assignedToYouNotOwned": [],
"protectedContacts": []
}
⌘I