Customers
Batch Create Customers
Creates up to 100 customers in one request, using the same fields as Create Customer.
POST
/
api
/
v1
/
contacts
/
batch
Batch Create Customers
curl --request POST \
--url https://app.chatflows.io/api/v1/contacts/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"first_name": "Jane",
"phone": "+919876543210"
},
{
"first_name": "John",
"phone": "+919811111111",
"email": "[email protected]"
}
]
}
'import requests
url = "https://app.chatflows.io/api/v1/contacts/batch"
payload = { "contacts": [
{
"first_name": "Jane",
"phone": "+919876543210"
},
{
"first_name": "John",
"phone": "+919811111111",
"email": "[email protected]"
}
] }
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: [
{first_name: 'Jane', phone: '+919876543210'},
{first_name: 'John', phone: '+919811111111', email: '[email protected]'}
]
})
};
fetch('https://app.chatflows.io/api/v1/contacts/batch', 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://app.chatflows.io/api/v1/contacts/batch",
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' => [
[
'first_name' => 'Jane',
'phone' => '+919876543210'
],
[
'first_name' => 'John',
'phone' => '+919811111111',
'email' => '[email protected]'
]
]
]),
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://app.chatflows.io/api/v1/contacts/batch"
payload := strings.NewReader("{\n \"contacts\": [\n {\n \"first_name\": \"Jane\",\n \"phone\": \"+919876543210\"\n },\n {\n \"first_name\": \"John\",\n \"phone\": \"+919811111111\",\n \"email\": \"[email protected]\"\n }\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://app.chatflows.io/api/v1/contacts/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contacts\": [\n {\n \"first_name\": \"Jane\",\n \"phone\": \"+919876543210\"\n },\n {\n \"first_name\": \"John\",\n \"phone\": \"+919811111111\",\n \"email\": \"[email protected]\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.chatflows.io/api/v1/contacts/batch")
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 \"first_name\": \"Jane\",\n \"phone\": \"+919876543210\"\n },\n {\n \"first_name\": \"John\",\n \"phone\": \"+919811111111\",\n \"email\": \"[email protected]\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": [
{
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"display_name": "Jane Doe",
"phone": "+919876543210",
"email": "[email protected]",
"type": "lead",
"is_active": true,
"contact_status_id": 1,
"contact_source_id": 1,
"group_ids": [
1
],
"label_ids": [
1
],
"custom_fields": {
"company": "Acme"
},
"created_at": "2026-06-26T10:00:00+00:00",
"updated_at": "2026-06-26T10:00:00+00:00"
}
],
"errors": [
{
"index": 1,
"errors": {
"phone": [
"The phone has already been taken."
]
}
}
]
}
}{
"message": "Missing API token.",
"error_code": "unauthenticated",
"status": 401
}{
"message": "Subscription required or expired.",
"error_code": "subscription_required",
"status": 402
}{
"message": "This token is missing the required scope: contacts:write.",
"error_code": "insufficient_scope",
"status": 403
}{
"message": "API request quota exhausted for this billing period.",
"error_code": "quota_exhausted",
"status": 429
}If a customer can’t be saved, for example because of a duplicate phone number, it’s listed under
errors. The rest are still created.Authorizations
Body
application/json
⌘I
Batch Create Customers
curl --request POST \
--url https://app.chatflows.io/api/v1/contacts/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contacts": [
{
"first_name": "Jane",
"phone": "+919876543210"
},
{
"first_name": "John",
"phone": "+919811111111",
"email": "[email protected]"
}
]
}
'import requests
url = "https://app.chatflows.io/api/v1/contacts/batch"
payload = { "contacts": [
{
"first_name": "Jane",
"phone": "+919876543210"
},
{
"first_name": "John",
"phone": "+919811111111",
"email": "[email protected]"
}
] }
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: [
{first_name: 'Jane', phone: '+919876543210'},
{first_name: 'John', phone: '+919811111111', email: '[email protected]'}
]
})
};
fetch('https://app.chatflows.io/api/v1/contacts/batch', 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://app.chatflows.io/api/v1/contacts/batch",
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' => [
[
'first_name' => 'Jane',
'phone' => '+919876543210'
],
[
'first_name' => 'John',
'phone' => '+919811111111',
'email' => '[email protected]'
]
]
]),
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://app.chatflows.io/api/v1/contacts/batch"
payload := strings.NewReader("{\n \"contacts\": [\n {\n \"first_name\": \"Jane\",\n \"phone\": \"+919876543210\"\n },\n {\n \"first_name\": \"John\",\n \"phone\": \"+919811111111\",\n \"email\": \"[email protected]\"\n }\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://app.chatflows.io/api/v1/contacts/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contacts\": [\n {\n \"first_name\": \"Jane\",\n \"phone\": \"+919876543210\"\n },\n {\n \"first_name\": \"John\",\n \"phone\": \"+919811111111\",\n \"email\": \"[email protected]\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.chatflows.io/api/v1/contacts/batch")
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 \"first_name\": \"Jane\",\n \"phone\": \"+919876543210\"\n },\n {\n \"first_name\": \"John\",\n \"phone\": \"+919811111111\",\n \"email\": \"[email protected]\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": [
{
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"display_name": "Jane Doe",
"phone": "+919876543210",
"email": "[email protected]",
"type": "lead",
"is_active": true,
"contact_status_id": 1,
"contact_source_id": 1,
"group_ids": [
1
],
"label_ids": [
1
],
"custom_fields": {
"company": "Acme"
},
"created_at": "2026-06-26T10:00:00+00:00",
"updated_at": "2026-06-26T10:00:00+00:00"
}
],
"errors": [
{
"index": 1,
"errors": {
"phone": [
"The phone has already been taken."
]
}
}
]
}
}{
"message": "Missing API token.",
"error_code": "unauthenticated",
"status": 401
}{
"message": "Subscription required or expired.",
"error_code": "subscription_required",
"status": 402
}{
"message": "This token is missing the required scope: contacts:write.",
"error_code": "insufficient_scope",
"status": 403
}{
"message": "API request quota exhausted for this billing period.",
"error_code": "quota_exhausted",
"status": 429
}
